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

Implement receipts and logs #1097

Merged
merged 6 commits into from
Aug 22, 2023

Conversation

hratoanina
Copy link
Contributor

This PR implements receipts and logs:

  • The prover now supports loading, inserting and hashing the receipt trie.
  • A receipt is generated after each transaction, and inserted in the receipt trie.
  • Logs are generated after a (successful) transaction and included in the generated receipt.
  • Logging syscodes are implemented.
  • Transaction and block Bloom filters are generated and updated after each transaction.

Most changes are additive, though process_normalized_txn (and internal functions) now return success and leftover_gas.

Copy link
Contributor

@wborgeaud wborgeaud left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

Just need to update some of the tests because of #1172.

evm/src/generation/mpt.rs Outdated Show resolved Hide resolved
evm/src/witness/memory.rs Show resolved Hide resolved
evm/tests/log_opcode.rs Outdated Show resolved Hide resolved
evm/tests/log_opcode.rs Outdated Show resolved Hide resolved
@LindaGuiga
Copy link
Contributor

Since the MemoryCTL fix was merged, we need to add BlockMetadata to the GlobalMetadata memory writes in apply_metadata_and_tries_memops for soundness. We will be adding this ti the current PR shortly.

@Nashtare
Copy link
Collaborator

Nashtare commented Aug 22, 2023

I don't understand the point of the last commit. The metadata are arrays, and as such should be serialized as arrays instead of vectors (cleaner and cheaper, we don't store the extra len).

@LindaGuiga
Copy link
Contributor

I don't understand the point of the last commit. The metadata are arrays, and as such should be serialized as arrays instead of vectors (cleaner and cheaper, we don't store the extra len).

On the main branch, everything is read and written as vecs, the arrays come from a rebasing mistake I made.

@LindaGuiga
Copy link
Contributor

I don't understand the point of the last commit. The metadata are arrays, and as such should be serialized as arrays instead of vectors (cleaner and cheaper, we don't store the extra len).

On the main branch, everything is read and written as vecs, the arrays come from a rebasing mistake I made.

Sorry about that, my mistake, they were supposed to be changed to arrays!

@LindaGuiga LindaGuiga merged commit 86fb6aa into 0xPolygonZero:main Aug 22, 2023
@Nashtare Nashtare deleted the receipts_and_logs branch September 8, 2023 20:43
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