-
Notifications
You must be signed in to change notification settings - Fork 667
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
Modify *trace* logging format to conform to spec #62
Comments
Here's some notes on a standard trace format: ethereum/tests#249 |
@pipermerriam, @cdetrio could you guide here - is there something else beyond extending current logging message in "apply_computation" function? |
@rayrapetyan the This issue is about the ability to generate debug information about EVM execution. See https://github.com/ethereum/go-ethereum/wiki/Management-APIs#debug_traceblock for the format that go-ethereum uses. I had originally hoped that we could facilitate this via the python standard library I'm not set on this implementation plan, just on having some way to get EVM trace data from transaction and block execution. |
@pipermerriam, so this issue is about implementing non-standard debug_* APIs and exposing them via JSON-RPC, correct? If yes - is rpc/modules/debug.py a good place to start coding from? Or a more generic rpc/modules/manage.py is better? Would be great if you can describe high-level interfaces we need here. |
I think this needs to be implemented in the |
In go implementation, debug_traceBlock is based on debug_traceTransaction calls, which supports pretty advanced options, e.g. optional JavaScript-based transaction tracing. Do we need to support this as well? |
@rayrapetyan no, for now I think it's adequate to start with just the full trace data as documented in the |
@pipermerriam, so I'm trying to obtain a state/computation of a chain right before a transaction with hash tx_hash, for that I use:
However it fails in state.py at:
Any idea of how to obtain a valid pre-execution state/computation for transaction with a given hash? |
It'd be good to have a full-ish stacktrace to diagnose why you're seeing this error |
So I'm basically trying to apply transactions from block N to VM obtained from block N-1. |
@rayrapetyan we garbage collect the state trie so it's likely that the state root for block N-1 is no longer present in the database. We currently don't have any public APIs for disabling this behavior. |
@pipermerriam, could you point me to the code which clears state trie in a full-chain node? We have to have state available in order to trace execution of any transaction from any block I believe... |
If this started happening, I missed it. AFAIK, we archive all the old states that we process during regular sync. But... If we skipped over a block during fast sync, then we most likely don't have the state at that block's state root. Are you running this against a live network? You should be able to create a local in-memory chain with some custom transactions to test with, then the state will definitely be present. Otherwise, be sure to test against a block that was synced during regular sync. |
@carver, I've created a new Ropsten full node from scratch and synced first few thousands of blocks from the network. Then trying to apply transactions from block 11 on top of block 10 and getting this stateRoot error, seems like state tree is not there in account_db. |
Ah, you did a partial fast sync so there won't be any state data yet. Fast sync just pulls headers and blocks, but doesn't actually process any of them. Then when it catches up, it requests all the state data from peers. You could force a regular sync right away in code. There is no cmd line option to do it yet. One way to do it would be to start from a fresh db, and deleting all these lines: py-evm/trinity/sync/full/service.py Lines 39 to 76 in 2a6f3cb
Looks like that should skip straight to regular sync, though I haven't tried it. |
Thanks @carver, will try that. |
@carver, @pipermerriam, thanks, it worked. I'm more or less done with everything, except some high-level design approach. See, In py-evm computation is performed in a context of:
Now, we can pass tracer flag\options as a new param all the way down to this point: (VM -> State -> TransactionExecutor -> Computator) or store it somewhere else (e.g. in a "state" or "message" params passed to apply_computation function). I don't really like any of these approaches. What are your thoughts here? Thanks. |
Can you open a WIP PR? It's much easier to discuss details in the context of a PR. (You can just add comments on lines that have open questions). |
@rayrapetyan just letting you know that I will create a bounty for this issue and have you assigned. Thanks for pushing this further! |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done This issue now has a funding of 120.0 DAI (120.0 USD @ $1.0/DAI) attached to it as part of the Ethereum Foundation fund.
|
Issue Status: 1. Open 2. Started 3. Submitted 4. Done Work has been started. These users each claimed they can complete the work by 8 months, 3 weeks from now. 1) zyfrank has applied to start work (Funders only: approve worker | reject worker). Seems a good task for beginner, I'd like to take it as my first step to the explore of Py-EVM Learn more on the Gitcoin Issue Details page. 2) rayrapetyan has been approved to start work. Will complete #1515 (#62) on top of #1531. Learn more on the Gitcoin Issue Details page. |
@rayrapetyan currently has first right of refusal for this since he started work on it already. |
@rayrapetyan Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
WIP PR: #1515 |
@rayrapetyan Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
1 similar comment
@rayrapetyan Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days |
@gitcoinbot this issue can be considered done and the bounty paid to @rayrapetyan |
Issue Status: 1. Open 2. Started 3. Submitted 4. Done Work for 120.0 DAI (120.0 USD @ $1.0/DAI) has been submitted by: @ceresstation please take a look at the submitted work:
|
|
Issue Status: 1. Open 2. Started 3. Submitted 4. Done The funding of 120.0 DAI (120.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @rayrapetyan.
|
Use updated CircleCI images
What is wrong?
There is a spec of some form which the data generated by tracing a transaction execution generates. Py-EVM needs to conform to that.
How can it be fixed
Talk with @cdetrio and figure out where this format is documented if anywhere and then make the appropriate changes.
The text was updated successfully, but these errors were encountered: