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

Multiple bug fixes: NDEV-2330, NDEV-2343, NDEV-2344, NDEV-2345 #220

Merged
merged 4 commits into from
Nov 9, 2023

Conversation

andreisilviudragnea
Copy link

@andreisilviudragnea andreisilviudragnea commented Oct 24, 2023

  • NDEV-2330: Fix off-by-one error in get_account_at(slot, tx_index)
    When the call get_account_at(slot, tx_index_in_block=Some(index)) does not find an account update in the slot with index <= tx_index_in_block, it should look in slot - 1 next, instead of slot.
    An integration test for this bug fix should:

    • make a transfer transaction;
    • call eth_getBalance for the recipient account at block number before the tx block;
    • call eth_getBalance for the recipient account at block number at the tx block;
    • compare the difference in balance from the 2 calls above; it should be equal to the value transfered in the transaction.
  • NDEV-2343: Pass gas_price from tracer to neon-api
    The gas_price for an executed transaction needs to be passed from tracer to neon-api for these APIs: eth_call, debug_traceCall, debug_traceTransaction and trace_replayTransaction (from NDEV-2301: Implement trace_replayTransaction stateDiff tracer #225).
    The gas_price value affects:

    • the return value of "GASPRICE" opcode;
    • the account balance diff of the transaction fee payer (the from account of a transaction), because the tx_fee = gas_price * consumed_gas.
  • NDEV-2344: Remove unused debug methods code
    Removed unused code from previous debug methods implementation.

  • NDEV-2345: Add account overrides logic to code_hash
    Account overrides logic was applied only to code retrieval method, but not also to code_hash method.

@andreisilviudragnea andreisilviudragnea changed the title NDEV-2329: Contract creation transaction has bytecode as returnValue NDEV-2329: Contract creation transaction has bytecode as returnValue (and other changes) Nov 7, 2023
@andreisilviudragnea andreisilviudragnea changed the title NDEV-2329: Contract creation transaction has bytecode as returnValue (and other changes) Multiple bug fixes Nov 7, 2023
@andreisilviudragnea andreisilviudragnea changed the title Multiple bug fixes NDEV-2329: Contract creation transaction has bytecode as returnValue (and other bug fixes) Nov 7, 2023
Deniskore
Deniskore previously approved these changes Nov 7, 2023
Copy link

@Deniskore Deniskore left a comment

Choose a reason for hiding this comment

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

LGTM.

stanislav-tkach
stanislav-tkach previously approved these changes Nov 7, 2023
@andreisilviudragnea andreisilviudragnea changed the title NDEV-2329: Contract creation transaction has bytecode as returnValue (and other bug fixes) Multiple bug fixes: NDEV-2330, NDEV-2343, NDEV-2344, NDEV-2345 Nov 8, 2023
@Deniskore Deniskore self-requested a review November 8, 2023 12:04
@neonlabstech
Copy link

Dapps report

Cost report for "Uniswap V2" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token approve 0.3237913464693761 0.09224599168293084 9 1 1552280 1527280 98.39
Direct swap 0.00212005229211 0.0006039887360728278 18 1 135000 10000 7.41

Cost report for "Curve" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Metapool: add liquidity 2.1446594304014397 0.6109991453963751 22 229 14207556 10106080 71.13
Metapool: swap 1 0.4884750242061 0.1391632713831562 19 230 5873516 2300000 39.16
Metapool: swap 2 0.4949034672348 0.14099469186003338 19 233 5906516 2330000 39.45
Metapool: withdraw admin fees 0.00212151337039 0.0006044049875147968 15 1 49500 10000 20.2
Pool: add liquidity 1.5469231033191135 0.4407080586892853 26 577 11359524 7287280 64.15
Pool: swap 1 0.57750353903664 0.16452690054789798 19 272 6335516 2720000 42.93
Pool: swap 2 0.57882592732 0.1649036401362735 19 272 6335516 2720000 42.93
Pool: swap 3 0.57836112614208 0.16477411319118668 19 272 6335516 2720000 42.93
Pool: withdraw admin fees 0.00211599201547 0.0006028425703408169 16 1 60500 10000 16.53
Stablecoin: transfer 0.00212416697789 0.0006051716034003381 10 1 33000 10000 30.3
Tri pool: add liquidity 2.112015651936333 0.601709711050366 3 39 15444572 9948040 64.41
Tri pool: swap 1 0.07857327054938 0.02238539277642384 20 37 3750516 370000 9.87
Tri pool: swap 2 0.07854989743811 0.022378733816289843 20 37 3750516 370000 9.87
Tri pool: swap 3 0.07642681899408 0.021773872334357482 20 36 3739516 360000 9.63
Tri pool: apply new fee 0.00212245518275 0.000604683915840768 8 1 33000 10000 30.3
Tri pool: withdraw admin fees 0.00212245838891 0.0006046848292703656 18 1 60500 10000 16.53
gauge v3: deposit 1.3388735757265535 0.38144283241688787 28 1 15191572 6308800 41.53
gauge controller: vote 1.0170469199785115 0.28975495886305236 26 1 20264596 4791520 23.64
gauge controller: vote 0.6949725518716339 0.19799651247434133 26 1 18595588 3274240 17.61
gauge controller: vote 0.6949725518716339 0.19799651247434133 26 1 18595588 3274240 17.61
gauge controller: vote 0.6462219118104665 0.18410753702199006 26 1 20264596 3044560 15.02
gauge controller: vote 1.0170222346999522 0.28974792606866207 26 1 20264596 4791520 23.64
gauge controller: vote 0.6948812824381824 0.19797050996608365 26 1 18595588 3274240 17.61
gauge controller: vote 1.0168886710895353 0.2897098740204412 26 1 20264596 4791520 23.64
gauge controller: vote 0.6949711031284839 0.1979960997298518 26 1 18595588 3274240 17.61
gauge controller: vote 0.6949711031284839 0.19784813343228475 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.32404152461938585 0.09224989429329496 9 1 1552280 1527280 98.39
Token approve 0.32404152461938585 0.09224989429329496 9 1 1552280 1527280 98.39
Deposit to lending pool 1.0706473872075486 0.30479769039260973 4 5 9318680 5046200 54.15
Borrow from lending pool 0.7043078436603167 0.2005061672386532 4 30 4876840 3319560 68.07
Repay 0.007425916244355 0.0021119619172611133 4 5 295000 35000 11.86
Flashloan 0.6459613588832417 0.1837141364233284 4 4 9418680 3044560 32.32
Withdraw 0.007425916244355 0.002113104840030282 4 5 3289560 35000 1.06
Liquidation 0.4396736489957708 0.12511271136851293 4 57 3629560 2072280 57.09

Cost report for "Robonomics" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
XRT transfer 0.32408074807925424 0.09221981164243369 10 1 199023192 1527280 0.77
Factory create lighthouse 4.411384882638643 1.2552954329139219 16 1 199022488 20771680 10.44
XRT increase allowance 0.3243560416661698 0.09229814867072737 9 1 199022936 1527280 0.77

Cost report for "Yearn" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Create new release 0.3240395815251876 0.09220809736478994 13 1 1718508 1527280 88.87
Clone strategy 4.031070237008713 1.1470738085418561 13 1 20979068 18996880 90.55
Set strategist authority 0.0021211340341 0.0006035859342228523 8 1 33000 10000 30.3
Set emergency shutdown 0.00212382948202 0.0006043529458424799 8 1 33000 10000 30.3
Emergency shutdown 0.00212382948202 0.0006043529458424799 8 1 33000 10000 30.3
Call strategy harvest 0.9683556306154013 0.2755534674228894 22 1 10217548 4561840 44.65
Withdraw from vault 0.00211553980668 0.0006019940513294224 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 0.6944397759077914 0.1976084840299402 16 1 5078524 3274240 64.47
borrow ether cToken 0.3728183055823918 0.10608847986629398 11 1 3387516 1756960 51.87
Repay borrow erc20 cToken 0.00212119408205 0.0006036030213552146 17 1 104500 10000 9.57
Mint erc20 cToken 0.3239862518857836 0.09231242107147311 16 1 1751508 1527280 87.2
Mint ether cToken 0.3239983761461361 0.09232095265479305 10 1 1718508 1527280 88.87
Transfer erc20 cToken 0.9680630428333644 0.27584243911137196 21 1 8493540 4561840 53.71
Add reserves for ether cToken 0.00212208898785 0.000604673638512907 8 1 33000 10000 30.3
Liquidate borrow 0.32408074807925424 0.09234442393087765 20 1 1839508 1527280 83.03
Redeem erc20 cToken 0.00212411219981 0.000605250137870069 16 1 1740508 10000 0.57

Cost report for "Uniswap V3" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Token approve 0.3237842913811624 0.09225995077667766 9 1 1552280 1527280 98.39
NonfungiblePositionManager - Mint position 3.6591814058121592 1.042656810011028 4 28 38247000 17260240 45.13
NonfungiblePositionManager - Increase liquidity 0.0487601402609 0.013893843092711137 23 23 9338680 230000 2.46
NonfungiblePositionManager - Decrease Liquidity 0.1481969062955632 0.0422276177196904 17 1 13800520 699040 5.07
NonfungiblePositionManager - Collect Fees 0.6454485766640248 0.18391582141888962 20 1 3119560 3044560 97.6
NonfungiblePositionManager - Burn Liquidity Position 0.0508123061640544 0.014478592662873935 15 1 7641400 239680 3.14
Direct swap 0.0021200060983 0.0006040801344657015 17 1 185000 10000 5.41
Burn transaction 0.0508123061640544 0.014478592662873935 11 1 4606840 239680 5.2
Collect transaction 0.3237842913811624 0.09225995077667766 12 1 1562280 1527280 97.76

Cost report for "Curve-Factory" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Deploy factory 28.18972298478779 8.032454088154113 3 25 3709916 132952880 3583.72
Deploy 2 104.76013854921993 29.8506304449805 3 70 15002666 494086520 3293.32
Deploy 3 107.73729894416347 30.698950387619153 3 72 15483729 508127880 3281.69
Deploy 4 110.22599789153674 31.408086835848913 3 74 15885269 519865480 3272.63

Cost report for "Saddle Finance" dApp

Action Fee Cost in $ Accounts TRx Estimated Gas Used Gas Used % of EG
Add liquidity 0.3254458735418658 0.0927334063841254 3 2 1732280 1532280 88.45
Swap DAI -> USDC 0.00212393213735 0.0006051988303973517 20 1 195000 10000 5.13
Swap USDC -> DAI 0.00212393213735 0.0006051988303973517 20 1 195000 10000 5.13
Remove liquidity 0.00212393213735 0.0006051988303973517 22 1 105000 10000 9.52
Add liquidity in 3 Tokens 0.3792408426795199 0.10806188690892708 4 30 1852280 1787280 96.49
Swap DAI -> USDC 3 pool 0.00212188824739 0.0006046164389962799 20 1 205000 10000 4.88
Swap USDC -> USDT 3 pool 0.00212188824739 0.0006046164389962799 20 1 205000 10000 4.88
Swap USDC -> DAI 3 pool 0.00212188824739 0.0006046164389962799 20 1 205000 10000 4.88
Remove liquidity 3 pool 0.003182832371085 0.0009069246584944196 3 2 125000 15000 12.0
Add liquidity in metapool 0.38660367992195527 0.11015987319067694 3 31 1822280 1822280 100.0
Swap SUSD -> LP metapool 0.00212153829226 0.000604516721857656 21 1 205000 10000 4.88
Swap USDC -> SUSD metapool 0.11138076034365 0.031737127897526946 4 52 3599560 525000 14.59
Swap DAI -> USDT metapool 0.05728153389102 0.016321951490156715 4 28 6404120 270000 4.22
Remove liquidity in Metapool 0.00212153829226 0.000604516721857656 22 1 105000 10000 9.52

@andreisilviudragnea andreisilviudragnea merged commit f02f377 into develop Nov 9, 2023
4 checks passed
@andreisilviudragnea andreisilviudragnea deleted the NDEV-2329 branch November 9, 2023 09:12
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.

5 participants