-
Notifications
You must be signed in to change notification settings - Fork 278
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
zktrie part3: include zktrie witness in block trace; add demo for generating witness data for mpt circuit #123
Conversation
we should gen_zktrie_witness_from_block_result to goroller later but now adding zktrie witness into blockresult is the most convenient way for the overall procedure at the cost of some computing overhead on l2geth |
@noel2004 it this branch still WIP? |
Yes. Another orderer, which would generate ops with the same order in rw table, is underway. It would be put on today. |
Current the witness can be genreated with order respect to rw table. I may have made some redudant "read" op for each account being accessed for do not consider more knowledge on each operation inside evm. However, it would sitll work well if we have adopted the new lookup scheme currently under discussed. To enable this feature, use argument |
Overall looks good to me now. Just some nitpicks. |
This code would allow some witness data used by mpt circuit being added into the block result. It would be controlled by cmd paramete
trace.mptwitness=<output scheme>
. Theoutput scheme
would be a number indicating the order of ops sequence (see below) and by default it is 0, which means there is no any output.For the storage state transistion inside a block, there would be many possible op sequence for mpt circuit to provide. For example, it would be the the "natrual" sequence, which collect ops in the order they were involved by the op codes executed in each tx; (the
output scheme
is 1.) or the "state" sequence like they are ordered in the rw table. (theoutput scheme
is 2.)Notice we consider the code here would be just a "demo" because to output an op sequence which would be completly consistent with the purposed scheme which connect storage and state circuit. The logic are currently implied in busmapping and it should not be duplicated in l2geth.