-
Notifications
You must be signed in to change notification settings - Fork 331
EIP-7873: EOF - TXCREATE and InitcodeTransaction type #1139
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
Conversation
44436bc to
b9c0734
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1139 +/- ##
==========================================
+ Coverage 94.48% 94.91% +0.43%
==========================================
Files 170 171 +1
Lines 18026 19640 +1614
==========================================
+ Hits 17032 18642 +1610
- Misses 994 998 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
be436a5 to
1056b16
Compare
5358ba4 to
22d63d2
Compare
fbe305e to
5a49ebe
Compare
9428ee6 to
6042c28
Compare
2de672f to
1cea026
Compare
5a49ebe to
13dfa85
Compare
741b8a9 to
b46a59e
Compare
Co-authored-by: pdobacz <[email protected]>
Co-authored-by: Andrei Maiboroda <[email protected]>
|
|
||
| private: | ||
| evmc_tx_context m_tx = {}; | ||
| std::optional<std::unordered_map<evmc::bytes32, bytes_view>> m_initcodes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it fly if we omit std::optional (empty map meaning no initcodes)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is optimization to avoid calling get_tx_context().initcodes on every get_tx_initcode_by_hash().
So it will work without optional, but for no initcodes it will check tx_context.initcodes_count on every TXCREATE (will not query the host though, thanks to cached tx_context).
| stack.push(0); // Assume failure. | ||
| state.return_data.clear(); | ||
|
|
||
| if (!check_memory(gas_left, state.memory, input_offset_u256, input_size_u256)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird that memory check happens after we push 0 to the stack. Please check this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same as what CREATE* is doing (stack is not observable after OOG)
test/state/state.cpp
Outdated
| return make_error_code(INIT_CODE_COUNT_LIMIT_EXCEEDED); | ||
| if (tx.initcodes.empty()) | ||
| return make_error_code(INIT_CODE_COUNT_ZERO); | ||
| if (std::any_of(tx.initcodes.begin(), tx.initcodes.end(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try std::ranges
No description provided.