Skip to content

Conversation

@gumb0
Copy link
Member

@gumb0 gumb0 commented Feb 21, 2025

No description provided.

@gumb0 gumb0 force-pushed the eof/txcreate branch 2 times, most recently from 44436bc to b9c0734 Compare February 24, 2025 11:19
@codecov
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 99.63122% with 6 lines in your changes missing coverage. Please review.

Project coverage is 94.91%. Comparing base (74885ff) to head (da95f45).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
test/state/errors.hpp 0.00% 6 Missing ⚠️
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     
Flag Coverage Δ
eof_execution_spec_tests 19.01% <0.98%> (-1.65%) ⬇️
ethereum_tests 22.40% <0.98%> (-1.96%) ⬇️
ethereum_tests_silkpre 17.91% <0.74%> (-1.60%) ⬇️
execution_spec_tests 19.59% <0.98%> (-1.71%) ⬇️
unittests 92.44% <99.63%> (+0.65%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
lib/evmone/advanced_instructions.cpp 100.00% <ø> (ø)
lib/evmone/eof.hpp 100.00% <ø> (ø)
lib/evmone/execution_state.hpp 95.52% <100.00%> (+0.78%) ⬆️
lib/evmone/instructions.hpp 100.00% <ø> (ø)
lib/evmone/instructions_calls.cpp 98.77% <100.00%> (+0.05%) ⬆️
test/state/host.cpp 100.00% <100.00%> (ø)
test/state/host.hpp 100.00% <100.00%> (ø)
test/state/state.cpp 99.07% <100.00%> (+0.06%) ⬆️
test/state/transaction.cpp 95.45% <100.00%> (ø)
test/state/transaction.hpp 100.00% <ø> (ø)
... and 8 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gumb0 gumb0 changed the title WIP TXCREATE EIP-7873: EOF - TXCREATE and InitcodeTransaction type Feb 24, 2025
@gumb0 gumb0 self-assigned this Feb 24, 2025
@gumb0 gumb0 changed the base branch from master to eof/compute-eofcreate-address February 25, 2025 18:41
@gumb0 gumb0 force-pushed the eof/compute-eofcreate-address branch from be436a5 to 1056b16 Compare February 26, 2025 10:22
@gumb0 gumb0 force-pushed the eof/txcreate branch 2 times, most recently from 5358ba4 to 22d63d2 Compare March 10, 2025 16:09
@gumb0 gumb0 requested review from chfast and pdobacz March 14, 2025 16:05
@gumb0 gumb0 force-pushed the eof/compute-eofcreate-address branch 2 times, most recently from fbe305e to 5a49ebe Compare March 20, 2025 18:27
@gumb0 gumb0 force-pushed the eof/txcreate branch 2 times, most recently from 9428ee6 to 6042c28 Compare March 21, 2025 15:56
@gumb0 gumb0 force-pushed the eof/txcreate branch 2 times, most recently from 2de672f to 1cea026 Compare April 2, 2025 09:25
@gumb0 gumb0 force-pushed the eof/compute-eofcreate-address branch from 5a49ebe to 13dfa85 Compare April 7, 2025 16:10
Base automatically changed from eof/compute-eofcreate-address to master April 7, 2025 16:58
@gumb0 gumb0 marked this pull request as ready for review April 7, 2025 17:04
@gumb0 gumb0 force-pushed the eof/txcreate branch 3 times, most recently from 741b8a9 to b46a59e Compare April 8, 2025 13:22

private:
evmc_tx_context m_tx = {};
std::optional<std::unordered_map<evmc::bytes32, bytes_view>> m_initcodes;
Copy link
Member

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)?

Copy link
Member Author

@gumb0 gumb0 Apr 8, 2025

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))
Copy link
Member

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.

Copy link
Member Author

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)

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(),
Copy link
Member

Choose a reason for hiding this comment

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

Try std::ranges

@gumb0 gumb0 requested review from chfast and pdobacz April 9, 2025 09:40
@gumb0 gumb0 merged commit 065a411 into master Apr 9, 2025
25 checks passed
@gumb0 gumb0 deleted the eof/txcreate branch April 9, 2025 10:59
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