Skip to content

sangsoo-osec/stress-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

deepbookv3 stress test scripts

This is the code to check how many orders can be filled in a single transaction

This code reflected: MystenLabs/deepbookv3#175 MystenLabs/deepbookv3#176

  1. run the sui-test-validator
sui-test-validator
  1. run the stress test script
cd test-scripts
npm install
ts-node scripts/test.ts
ts-node scripts/fix.ts

if an error occurs, please execute the commands again.

  1. result of test.ts
#orders_in_tree 500
try filling 300 orders within single tx
{ status: 'success' }
{
  computationCost: '1873000000',
  storageCost: '101444800',
  storageRebate: '417303612',
  nonRefundableStorageFee: '4215188'
}

#orders_in_tree 1000
try filling 300 orders within single tx
{ status: 'success' }
{
  computationCost: '4424000000',
  storageCost: '160466400',
  storageRebate: '530569908',
  nonRefundableStorageFee: '5359292'
}

#orders_in_tree 1500
try filling 300 orders within single tx
{ status: 'failure', error: 'InsufficientGas in command 1' }
{
  computationCost: '5000000000',
  storageCost: '5183200',
  storageRebate: '5131368',
  nonRefundableStorageFee: '51832'
}

This shows the possibility of a DOS as vec_set::remove.

  1. result of fix.ts
start place limit order
0
..
98
99
end place limit order
try filling 100 orders within single tx
{ status: 'success' }
{
  computationCost: '248000000',
  storageCost: '1577015200',
  storageRebate: '1668379284',
  nonRefundableStorageFee: '16852316'
}

This demonstrates MystenLabs/deepbookv3#220 and MystenLabs/deepbookv3#204 can protect against DOS attacks.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors