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

Skaled on archival node couldn't trace block with failed transaction #1859

Closed
oleksandrSydorenkoJ opened this issue Apr 2, 2024 · 3 comments · Fixed by #1875
Closed

Skaled on archival node couldn't trace block with failed transaction #1859

oleksandrSydorenkoJ opened this issue Apr 2, 2024 · 3 comments · Fixed by #1875

Comments

@oleksandrSydorenkoJ
Copy link

Note:
debug_traceTransaction, debug_traceBlockByNumber and debug_traceBlockByHash methods are affected

Version:
skalenetwork/schain:3.18.1-develop.0-historic

Preconditions:
Active schain medium type
Archival node connected to schain
Address with whitelisted deployer role (schain owner is preferable)
Test token contract link

To Reproduce:

  1. Deploy the test token contract on the chain.
  2. Run load erc20 transfer tests, should be at least 2 transactions per block
  3. Send transaction expected to revert (send insufficient balance of tokens to another address)
  4. Check the reverted transaction through debug_traceTransaction
curl http://localhost:10131 -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x36cc5e62f8ebcf4d007f7988bef2ef86d189407abd5fc946b25b099a4e14db01", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}'
  1. Check the valid transaction from the same block where the reverted transaction is.

Expected Behavior:
The reverted transaction shouldn't affect other transactions within the block.
The reverted transaction should return a trace as on Ethereum - with readable error and without any errors with all accompanying structures.

Actual State:
The archival node returns the error with the index of failed transaction and doesn't return any information for other valid transactions within the block

debug_traceTransaction:206:Could not trace block:86484:Could not execute historic call for transactionIndex:48:Exception doing trace for transaction index:48:State check failed::getLastOpRecord()->m_gasRemaining >= getLastOpRecord()->m_opGas /home/s5/actions-runner-2/_work/skaled/skaled/libhistoric/AlethStandardTrace.cpp:210

Logs:
geth attach

> debug.traceTransaction("0x952eb0bec98d5bf36e1fe6163cb61c52693e59aa0191aa5025c70bc79a0bf97c", {"tracer":"callTracer"})

Error: debug_traceTransaction:206:Could not trace block:86484:Could not execute historic call for transactionIndex:48:Exception doing trace for transaction index:48:State check failed::getLastOpRecord()->m_gasRemaining >= getLastOpRecord()->m_opGas /home/s5/actions-runner-2/_work/skaled/skaled/libhistoric/AlethStandardTrace.cpp:210
	at web3.js:6367:9(39)
	at send (web3.js:5101:62(29))
	at <eval>:1:23(6)


JSON-RPC example:
debug_traceBlockByNumber ('latest')

curl http://localhost:10131 -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x952eb0bec98d5bf36e1fe6163cb61c52693e59aa0191aa5025c70bc79a0bf97c", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}'

{"error":{"code":0,"data":null,"message":"debug_traceTransaction:206:Could not trace block:86484:Could not execute historic call for transactionIndex:48:Exception doing trace for transaction index:48:State check failed::getLastOpRecord()->m_gasRemaining >= getLastOpRecord()->m_opGas /home/s5/actions-runner-2/_work/skaled/skaled/libhistoric/AlethStandardTrace.cpp:210"},"id":1,"jsonrpc":"2.0"}

@PolinaKiporenko PolinaKiporenko moved this to Ready For Pickup in SKALE Engineering 🚀 Apr 3, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
@kladkogex
Copy link
Collaborator

Hey - I tried it on my machine using transfer function of the contract, and it works

Please add more detailed instructions to reproduce the bug (how many tokens were originally minted, and which function of the smart contract was called with which parameters?)

@kladkogex kladkogex moved this from Ready For Pickup to Incomplete in SKALE Engineering 🚀 Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 22, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
@kladkogex kladkogex linked a pull request Apr 23, 2024 that will close this issue
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
kladkogex added a commit that referenced this issue Apr 23, 2024
@github-project-automation github-project-automation bot moved this from Incomplete to Ready For Release Candidate in SKALE Engineering 🚀 Apr 29, 2024
@oleksandrSydorenkoJ
Copy link
Author

Verified on legacy network
skale_schain_these-long-sadalsuud
skalenetwork/schain:3.18.1-beta.0-historic

Execution reverted in block 299549

curl http://localhost:10195/   -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x6f2af81740fbd00b2dc808aebed08cd9191e26c20c518506c81069056ba4a5a2", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}'

{"id":1,"jsonrpc":"2.0","result":{"error":"execution reverted","from":"0x482d7f53cba6ae73a354533673c48e2dfd560949","gas":"0x30d40","gasUsed":"0x64bc","input":"0x56b8c7240000000000000000000000007cef6369dfd5377d823a2c65b3c2de740d52a5b400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008366393063613830343832303136623833303138366130393438386664356530313037383632396363313934633933336439363331623934342020202020202020202020202020386665313062316438306239306334343764393330313962303030303033306365653739333865396562613265393132313162373862333239653236320000000000000000000000000000000000000000000000000000000000","output":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000014496e73756666696369656e742062616c616e6365000000000000000000000000","revertReason":"Insufficient balance","to":"0x8722eb776a5d9a2ffd914648381fe2daf80c7add","type":"CALL","value":"0x0"}}

Success execution in block 299549

$ curl http://localhost:10195/   -X POST -H "Content-Type: application/json" --data '{"method":"debug_traceTransaction","params":["0x652cdca90b236cc37d4ce2b5b0ed9072c510468e6dfef40b48fca7c5c1512c6e", {"tracer": "callTracer"}], "id":1,"jsonrpc":"2.0"}'

{"id":1,"jsonrpc":"2.0","result":{"from":"0xe3cc6ec63b5652d1594bc63bb293f4e80f76dbdd","gas":"0x30d40","gasUsed":"0x19062","input":"0x56b8c7240000000000000000000000007cef6369dfd5377d823a2c65b3c2de740d52a5b400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008366393063613830343832303136623833303138366130393438386664356530313037383632396363313934633933336439363331623934342020202020202020202020202020386665313062316438306239306334343764393330313962303030303033306365653739333865396562613265393132313162373862333239653236320000000000000000000000000000000000000000000000000000000000","output":"0x0000000000000000000000000000000000000000000000000000000000000001","to":"0x8722eb776a5d9a2ffd914648381fe2daf80c7add","type":"CALL","value":"0x0"}}

@PolinaKiporenko
Copy link
Contributor

3.18.1-beta.0

@PolinaKiporenko PolinaKiporenko moved this from Ready For Release Candidate to Merged To Release Candidate in SKALE Engineering 🚀 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants