Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other changes #219

Closed
wants to merge 5 commits into from
Closed

Other changes #219

wants to merge 5 commits into from

Conversation

andreisilviudragnea
Copy link

No description provided.

@andreisilviudragnea andreisilviudragnea marked this pull request as ready for review October 23, 2023 06:31
@andreisilviudragnea andreisilviudragnea changed the title NDEV-2301: Implement trace_replayTransaction stateDiff tracer NDEV-2301: Implement trace_replayTransaction stateDiff tracer - work in progress Oct 23, 2023
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301 branch 2 times, most recently from 5403984 to 5e46d9b Compare October 24, 2023 19:39
@andreisilviudragnea andreisilviudragnea changed the base branch from develop to NDEV-2329 October 24, 2023 19:40
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301 branch 2 times, most recently from 85a34d0 to 88a6873 Compare October 25, 2023 09:08
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301 branch 6 times, most recently from 15db83a to 0ab961f Compare October 26, 2023 10:32
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301 branch 6 times, most recently from 1950d56 to 56d0846 Compare October 28, 2023 10:54
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301 branch 5 times, most recently from cffd745 to 8520a13 Compare October 28, 2023 19:07
@andreisilviudragnea andreisilviudragnea changed the base branch from NDEV-2329 to NDEV-2301-slim October 28, 2023 19:11
@andreisilviudragnea andreisilviudragnea changed the title NDEV-2301: Implement trace_replayTransaction stateDiff tracer - work in progress NDEV-2301: Other changes Oct 28, 2023
@andreisilviudragnea andreisilviudragnea changed the title NDEV-2301: Other changes NDEV-2301: Implement trace_replayTransaction stateDiff tracer - other changes Oct 28, 2023
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301 branch 2 times, most recently from 77f6b7b to 3ff6ddd Compare October 29, 2023 09:47
@neonlabstech
Copy link

Dapps report

Cost report for "Curve" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Metapool: add liquidity 3.2853300245884953 0.47796282188403166 22 229 14207556 10106080 71.13
Metapool: swap 1 0.744609725861 0.1083287715727727 19 230 5873516 2300000 39.16
Metapool: swap 2 0.75577532476542 0.10995318711715936 19 233 5906516 2330000 39.45
Metapool: withdraw admin fees 0.00323714581007 0.0004709527915463915 15 1 49500 10000 20.2
Pool: add liquidity 2.3647630090381098 0.34403508701637997 26 577 11359524 7287280 64.15
Pool: swap 1 0.88545413639296 0.12881937416082792 19 272 6335516 2720000 42.93
Pool: swap 2 0.8841264623744 0.1286262188870187 19 272 6335516 2720000 42.93
Pool: swap 3 0.88332327209744 0.12845309989246045 19 272 6335516 2720000 42.93
Pool: withdraw admin fees 0.00328347326915 0.0004774788083013354 16 1 60500 10000 16.53
Stablecoin: transfer 0.00330710943975 0.0004809159523393061 10 1 33000 10000 30.3
Tri pool: add liquidity 3.333462835566807 0.4847482320619791 3 39 15444572 9948040 64.41
Tri pool: swap 1 0.12366199923572 0.017982782007699302 20 37 3750516 370000 9.87
Tri pool: swap 2 0.12336901017251 0.0179401758838544 20 37 3750516 370000 9.87
Tri pool: swap 3 0.12009067538508 0.01746344430750138 20 36 3739516 360000 9.63
Tri pool: apply new fee 0.00333431100324 0.00048487157160417697 8 1 33000 10000 30.3
Tri pool: withdraw admin fees 0.0033395974495 0.0004856403203812996 18 1 60500 10000 16.53
gauge v3: deposit 2.1065022402914546 0.3063250701105398 28 1 15191572 6308800 41.53
gauge controller: vote 1.5970309695438143 0.23223835909451743 26 1 20264596 4791520 23.64
gauge controller: vote 1.0913160503804928 0.1586963535377608 26 1 18595588 3274240 17.61
gauge controller: vote 1.0913160503804928 0.1586963535377608 26 1 18595588 3274240 17.61
gauge controller: vote 1.0164376185215998 0.14780772591197905 26 1 20264596 3044560 15.02
gauge controller: vote 1.5996666769249466 0.23262164055174697 26 1 20264596 4791520 23.64
gauge controller: vote 1.0931171361602867 0.15895980406220822 26 1 18595588 3274240 17.61
gauge controller: vote 1.5978192013971604 0.23235298284051742 26 1 20264596 4791520 23.64
gauge controller: vote 1.0918546811831398 0.1587762193491284 26 1 18595588 3274240 17.61
gauge controller: vote 1.0918546811831398 0.1587762193491284 26 1 18595588 3274240 17.61

Cost report for "Aave" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token mint 0.49423251240116545 0.07187070875901284 9 1 1552280 1527280 98.39
Token approve 0.49423251240116545 0.07187070875901284 9 1 1552280 1527280 98.39
Deposit to lending pool 1.6329658635474575 0.2374639689773523 4 5 9318680 5046200 54.15
Borrow from lending pool 1.0742198410680508 0.15621178170870348 4 30 4876840 3319560 68.07
Repay 0.01132610780868 0.0016470292327310314 4 5 295000 35000 11.86
Flashloan 0.9852289939998509 0.1432708377372454 4 4 9418680 3044560 32.32
Withdraw 0.01132610780868 0.0016470292327310314 4 5 3289560 35000 1.06
Liquidation 0.6705961911363254 0.0975173068115389 4 57 3629560 2072280 57.09

Cost report for "Uniswap V3" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token approve 0.49389206610021846 0.07182120145965577 9 1 1552280 1527280 98.39
NonfungiblePositionManager - Mint position 5.58161934614847 0.8116646289228039 4 28 38247000 17260240 45.13
NonfungiblePositionManager - Increase liquidity 0.07437743910943 0.010815774557726017 23 23 9338680 230000 2.46
NonfungiblePositionManager - Decrease Liquidity 0.22605567406546065 0.032872430638403456 17 1 13800520 699040 5.07
NonfungiblePositionManager - Collect Fees 0.9845503305000269 0.14317075907595792 20 1 3119560 3044560 97.6
NonfungiblePositionManager - Burn Liquidity Position 0.07750775915542688 0.011270977591285963 15 1 7641400 239680 3.14
Direct swap 0.00323380170041 0.0004702617392728295 17 1 185000 10000 5.41
Burn transaction 0.07750775915542688 0.011271233366891177 11 1 4606840 239680 5.2
Collect transaction 0.49389206610021846 0.07182213491566071 12 1 1562280 1527280 97.76

Cost report for "Uniswap V2" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token approve 0.49389206610021846 0.07182213491566071 9 1 1552280 1527280 98.39
Direct swap 0.00323380170041 0.0004702617392728295 18 1 135000 10000 7.41

Cost report for "Robonomics" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
PublicAmbix setSink 0.9883475387594138 0.1437262008131465 10 1 199023640 3044560 1.53
PublicAmbix appendSource 1.9734488037099376 0.28698375998506825 12 1 199023640 6079120 3.05
XRT approve 0.4957969062841519 0.07210000081426177 9 1 199022872 1527280 0.77
PublicAmbix run 0.00324627380889 0.0004720810906596156 20 1 199021400 10000 0.01
KycAmbix setSink 0.49608932923263555 0.07214252567586649 10 1 199023576 1527280 0.77
KycAmbix appendSource 1.4817716107502266 0.2154828579757443 12 1 199023576 4561840 2.29
KycAmbix run 0.00324818847384 0.0004723595259275738 19 1 199021400 10000 0.01
DutchAuction started 0.00324576486388 0.0004720070786293461 8 1 199021272 10000 0.01
DutchAuction bid 0.49600562070958903 0.07213035257735918 11 1 199026008 1527280 0.77

Cost report for "Curve-Factory" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Deploy factory 42.939750527019726 6.244403724028 3 25 3709916 132952880 3583.72
Deploy 2 159.5749705276286 23.205783172805546 3 70 15002666 494086520 3293.32
Deploy 3 164.10990422338662 23.86526434143023 3 72 15483729 508127880 3281.69
Deploy 4 167.90079326457135 24.416544713477464 3 74 15885269 519865480 3272.63

Cost report for "Yearn" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Create new release 0.4951139790276238 0.07200068785944568 13 1 1718508 1527280 88.87
Clone strategy 6.168492839781878 0.8970373415685383 13 1 20979068 18996880 90.55
Set strategist authority 0.00324818847384 0.0004723595259275738 8 1 33000 10000 30.3
Set emergency shutdown 0.00323343218939 0.0004702136308899578 8 1 33000 10000 30.3
Emergency shutdown 0.00323343218939 0.0004702136308899578 8 1 33000 10000 30.3
Call strategy harvest 1.4818894783085168 0.2154925298418757 22 1 10217548 4561840 44.65
Withdraw from vault 0.00324064887382 0.00047124676595032116 14 1 71500 10000 13.99

Cost report for "Compound-Finance" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
borrow erc20 cToken 1.0612085720386022 0.15431820201565194 16 1 5078524 3274240 64.47
borrow ether cToken 0.5695425839646685 0.08282140744484963 11 1 3387516 1756960 51.87
Repay borrow erc20 cToken 0.00324961538443 0.0004725506526999649 17 1 104500 10000 9.57
Mint erc20 cToken 0.4958643992218362 0.07210981580261752 16 1 1751508 1527280 87.2
Mint ether cToken 0.49593829076017176 0.07212056129115654 10 1 1718508 1527280 88.87
Transfer erc20 cToken 1.4808981712346758 0.2153558402614661 21 1 8493540 4561840 53.71
Add reserves for ether cToken 0.00324627380889 0.0004720647294396188 8 1 33000 10000 30.3
Liquidate borrow 0.4973539441161825 0.07232392240666 20 1 1839508 1527280 83.03
Redeem erc20 cToken 0.00324620062193 0.0004720540867814498 16 1 1740508 10000 0.57

Cost report for "Saddle Finance" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Add liquidity 0.4974315104564672 0.07233770895778009 3 2 1732280 1532280 88.45
Swap DAI -> USDC 0.00324634864683 0.0004720919737762034 20 1 195000 10000 5.13
Swap USDC -> DAI 0.00324634864683 0.0004720919737762034 20 1 195000 10000 5.13
Remove liquidity 0.00324634864683 0.0004720919737762034 22 1 105000 10000 9.52
Add liquidity in 3 Tokens 0.591073055947638 0.0859552919248926 4 30 1852280 1787280 96.49
Swap DAI -> USDC 3 pool 0.00330710943975 0.00048092795714657237 20 1 205000 10000 4.88
Swap USDC -> USDT 3 pool 0.00330710943975 0.00048092795714657237 20 1 205000 10000 4.88
Swap USDC -> DAI 3 pool 0.00330710943975 0.00048092795714657237 20 1 205000 10000 4.88
Remove liquidity 3 pool 0.004960664159625 0.0007213919357198586 3 2 125000 15000 12.0
Add liquidity in metapool 0.6132106358622564 0.0891745930331472 3 31 1822280 1822280 100.0
Swap SUSD -> LP metapool 0.0033650736213 0.0004893402904687668 21 1 205000 10000 4.88
Swap USDC -> SUSD metapool 0.17666636511825 0.02569036524961026 4 52 3599560 525000 14.59
Swap DAI -> USDT metapool 0.0908569877751 0.013212187842656703 4 28 6404120 270000 4.22
Remove liquidity in Metapool 0.0033650736213 0.0004893402904687668 22 1 105000 10000 9.52

@andreisilviudragnea andreisilviudragnea changed the title NDEV-2301: Implement trace_replayTransaction stateDiff tracer - other changes Other changes Nov 6, 2023
@andreisilviudragnea andreisilviudragnea force-pushed the NDEV-2301-slim branch 4 times, most recently from fd86e6f to 6754e64 Compare November 9, 2023 09:13
NDEV-2301: Implement trace_replayTransaction stateDiff tracer

test_trace_contract_creation

First tracer test

Fix first tracer test

Clean up test

Improve TestAccountStorage

Extract nonce

test_trace_contract_call

wip

Reorder fields like Alchemy and QuickNode

Initialize output and state_diff

Cleanup

Cargo clippy + fmt

wip

Extract ethereum_account_closure

wip

wip code

wip storage

wip storage 2

fix storage diff

wip diff

Contract creation transaction has bytecode as returnValue

Fix code diff

Fix diff balance and nonce for 0 value

Debug balance diff and fix get_account_at

Make StructLoggerResult Deserialize

Add #[serde(default)] to StructLog

Fix compile error

Fix Solana program build

Pass gas_used in TxParamsRequestModel

Add gas_price to TxParamsRequestModel

Compute balance diff for fee payer

Use unwrap_or_default

Read call_analytics config

Extract EmulatorAccountStorage::ethereum_account_closure

Add EthereumAccountOwned

Extract build_state_diff

Immutable borrow in ethereum_account_closure

Use exit_status and gas_used from tracer

Decouple tracing from evm_loader crate

Clean up build_state_diff

Remove initial_accounts

Clean up build_state_diff

Clean up storage diff

Clean up ethereum_account_map_or

Remove unused types

Clean up code

Add TODOs

More TODOs

Remove cached accounts

Fix storage diff

Clean up build_state_diff

Clean up build_code_diff

Create EthereumAccountOwned

Remove cached accounts 2

Revert "Remove cached accounts 2"

This reverts commit 1f769b3.

Revert "Remove cached accounts"

This reverts commit a04d5b3.

Remove TODO

Some renames

Revert "Add #[serde(default)] to StructLog"

This reverts commit a9403d8.

Revert "Make StructLoggerResult Deserialize"

Rebase

test_trace_increment_call

Clean up tests

Extract tx_params_to_transaction

Clean up tx_params_to_transaction

Use tx_params_to_transaction

Clean up tests

test_trace_transfer_transaction

Clean up tests

More assertions

More assertions 2

Move account module

Cleanup

Move tests module

Make code testable

Make code testable 2

Use default syntax

Extract tx_fee

Clean up signatures

Move build_state_diff to state_diff module

Clean up state_diff

Remove tests duplication

test_trace_state_diff_increment_call

Clean up tests

Use map-macro

Clean up tests

Add test_trace_state_diff_transfer_transaction

Clean up tests

Fix state diff

Clean up state diff

Make build_storage_diff non-mutable

cargo clippy --fix

Better error messages

Try mess

Fix off-by-one error

Remove unused code

Fix TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants