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

NDEV-3096. Get Account State after emulation for debug_traceTransacti… #520

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

ancientmage
Copy link

Added flag to provide Account Data for tracer. In case of RPC debug_traceTransaction we should compare account after emulation and in tracer database

@ancientmage ancientmage force-pushed the NDEV-3096-get-state-of-accounts-after-emulation branch 2 times, most recently from 664362e to 8308534 Compare August 18, 2024 10:32
@ancientmage ancientmage force-pushed the NDEV-3096-get-state-of-accounts-after-emulation branch from 8308534 to 37d0415 Compare August 18, 2024 16:09
evm_loader/program/src/account/mod.rs Outdated Show resolved Hide resolved
@ancientmage ancientmage force-pushed the NDEV-3096-get-state-of-accounts-after-emulation branch from 37d0415 to 9ea986d Compare August 19, 2024 11:33
evm_loader/lib/src/types/mod.rs Outdated Show resolved Hide resolved
evm_loader/lib/src/commands/emulate.rs Show resolved Hide resolved
evm_loader/lib/src/types/mod.rs Outdated Show resolved Hide resolved
evm_loader/lib/src/types/tracer_ch_common.rs Outdated Show resolved Hide resolved
evm_loader/lib/src/types/tracer_ch_db.rs Outdated Show resolved Hide resolved
@ancientmage ancientmage force-pushed the NDEV-3096-get-state-of-accounts-after-emulation branch 2 times, most recently from c8e6fff to b0f2304 Compare August 21, 2024 09:17
@ancientmage ancientmage force-pushed the NDEV-3096-get-state-of-accounts-after-emulation branch from b0f2304 to 4e2206e Compare August 21, 2024 09:23
Copy link

@s-medvedev s-medvedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but need to fix the tests

@neonlabstech
Copy link

Dapps report

Cost report for "Saddle Finance" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Add liquidity 0.00235464 0.0008084656439999999 4 2 1432320 1177320 82.2
Swap DAI -> USDC 2e-05 6.8670000000000005e-06 22 1 190000 10000 5.26
Swap USDC -> DAI 2e-05 6.8674000000000005e-06 22 1 190000 10000 5.26
Remove liquidity 2e-05 6.8670000000000005e-06 24 1 100000 10000 10.0
Add liquidity in 3 Tokens 0.00241464 0.0008291149368 4 7 1492320 1207320 80.9
Swap DAI -> USDC 3 pool 2e-05 6.8670000000000005e-06 22 1 200000 10000 5.0
Swap USDC -> USDT 3 pool 2e-05 6.8674000000000005e-06 22 1 200000 10000 5.0
Swap USDC -> DAI 3 pool 2e-05 6.8670000000000005e-06 22 1 200000 10000 5.0
Remove liquidity 3 pool 3e-05 1.03005e-05 4 2 180000 15000 8.33
Add liquidity in metapool 0.00241464 0.0008291149368 4 7 1522320 1207320 79.31
Swap SUSD -> LP metapool 2e-05 6.867600000000001e-06 23 1 200000 10000 5.0
Swap USDC -> SUSD metapool 0.00015 5.15055e-05 5 11 560000 75000 13.39
Swap DAI -> USDT metapool 0.00013 4.4638099999999995e-05 4 7 330000 65000 19.7
Remove liquidity in Metapool 2e-05 6.867200000000001e-06 24 1 100000 10000 10.0

Cost report for "Uniswap V3" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token approve 0.00234464 0.0008050790368 10 1 1192320 1172320 98.32
NonfungiblePositionManager - Mint position 0.02747064 0.009432593656800001 4 7 14000320 13735320 98.11
NonfungiblePositionManager - Increase liquidity 8e-05 2.7468800000000004e-05 23 6 230000 40000 17.39
NonfungiblePositionManager - Decrease Liquidity 0.00139808 0.0004800447488 18 1 829040 699040 84.32
NonfungiblePositionManager - Collect Fees 2e-05 6.867200000000001e-06 21 1 80000 10000 12.5
NonfungiblePositionManager - Burn Liquidity Position 2e-05 6.8674000000000005e-06 16 1 50000 10000 20.0
Direct swap 2e-05 6.8674000000000005e-06 18 1 180000 10000 5.56
Burn transaction 0.00047936 0.0001645930496 12 1 279680 239680 85.7
Collect transaction 0.00234464 0.0008050555904 13 1 1202320 1172320 97.5

Cost report for "Aave" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token mint 0.00234464 0.0008050555904 10 1 1192320 1172320 98.32
Token approve 0.00234464 0.0008051024832 10 1 1192320 1172320 98.32
Deposit to lending pool 0.00797264 0.0027374856704 4 2 4156320 3986320 95.91
Borrow from lending pool 0.00477928 0.0016410135808 5 10 2644640 2389640 90.36
Repay 0.00013 4.46368e-05 5 10 290000 65000 22.41
Flashloan 0.00471928 0.0016204119808 4 6 2634640 2359640 89.56
Withdraw 7e-05 2.4035199999999996e-05 5 5 250000 35000 14.0
Liquidation 0.00247464 0.0008497418832000001 5 11 1752320 1237320 70.61

@neonlabstech
Copy link

Solana Requests Statistics
count min_time max_time average_time median_time
getAccountInfo 58340 0 0.133 0.00149995 0
getSlot 55329 0 0.172 0.000948201 0
getBlocks 22280 0 0.166 0.000640081 0
getBlock 14619 0 0.037 0.00144305 0.001
getMultipleAccounts 13683 0 0.104 0.00211335 0.001
getTransaction 8096 0 0.148 0.0110429 0.004
getBlockTime 6405 0 0.074 0.00057861 0
sendTransaction 5222 0 0.13 0.00730563 0.003
getLatestBlockhash 4986 0 0.183 0.00272002 0.001
getBalance 1819 0 0.078 0.00164926 0.001
getSignatureStatuses 1114 0 0.138 0.00116966 0
getVersion 581 0 0.036 0.0011704 0
isBlockhashValid 539 0 0.031 0.000500928 0
getSignaturesForAddress 61 0 0.004 0.00119672 0.001
simulateTransaction 38 0 0.001 0.0005 0.0005
requestAirdrop 32 0 0.002 0.0009375 0.001
getHealth 3 0.001 0.011 0.00433333 0.001
getTokenAccountBalance 3 0 0.001 0.000333333 0
getFirstAvailableBlock 2 0.001 0.001 0.001 0.001
getMinimumBalanceForRentExemption 1 0.001 0.001 0.001 0.001
getClusterNodes 1 0.001 0.001 0.001 0.001

@ancientmage
Copy link
Author

Looks good, but need to fix the tests

I relaunched tests, it's passed everywhere: neon-evm, neon-proxy, neon-tests & tracer-api

@ancientmage ancientmage merged commit daae9c9 into develop Aug 28, 2024
4 checks passed
anton-lisanin pushed a commit that referenced this pull request Sep 1, 2024
#520)

* NDEV-3096. Get Account State after emulation for debug_traceTransaction rpc

* NDEV-3096. Add db request: get_accounts_in_transaction for tracer debug_traceTransaction
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.

4 participants