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

Add journal entry for logs #1286

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

LindaGuiga
Copy link
Contributor

We noticed a few tests failing, such as logInOOG_Call due to logs happening within a CALL, and not reverting. To fix this, this PR adds logs to the journal so they can be reverted when necessary.

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 good to me!

Comment on lines 269 to 286
%macro journal_add_log
%journal_add_2(@JOURNAL_ENTRY_LOG)
%endmacro

global revert_log:
// stack: entry_type, ptr, retdest
POP
// First, reduce the number of logs.
%mload_global_metadata(@GLOBAL_METADATA_LOGS_LEN)
%decrement
%mstore_global_metadata(@GLOBAL_METADATA_LOGS_LEN)
// stack: ptr, retdest
// Second, restore payload length.
%journal_load_2
// stack: prev_logs_data_len, prev_payload_len, retdest
%mstore_global_metadata(@GLOBAL_METADATA_LOGS_DATA_LEN)
%mstore_global_metadata(@GLOBAL_METADATA_LOGS_PAYLOAD_LEN)
JUMP
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: For other journal entries, we have a file evm/src/cpu/kernel/asm/journal/X.asm containing journal_add_X and revert_X. So maybe we can add a evm/src/cpu/kernel/asm/journal/log.asm with this code.

@LindaGuiga LindaGuiga merged commit d7990ee into 0xPolygonZero:main Oct 11, 2023
2 checks passed
@Nashtare Nashtare deleted the add-journal-log branch October 11, 2023 14:37
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.

2 participants