-
Notifications
You must be signed in to change notification settings - Fork 80
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
EIP-3860: Limit and meter initcode #808
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f9200a2
tiny optimization
yperbasis 2bb8884
EIP-3860 intrinsic gas
yperbasis 5f6ccd9
Merge branch 'master' into eip-3860
yperbasis 5a6f93c
Switch to eip-3860 evmone
yperbasis 93e5beb
Merge branch 'master' into eip-3860
yperbasis 5362fd4
Update tests to v11.2
yperbasis fcf273e
Rule 1 of EIP-3860 spec
yperbasis 883e1a5
Move Rule 3 to Silkworm
yperbasis d5f9dde
Update evmone
yperbasis 1feeeb4
Merge branch 'master' into eip-3860
yperbasis ef0c4ba
Update according to ethereum/EIPs/pull/6040
yperbasis 5ed90b5
cosmetic reshuffling
yperbasis 79c41a9
small clarifications
yperbasis 8bf10f9
Update evmone
yperbasis d7855ee
small comment update
yperbasis da495e1
Update evmone
yperbasis ab77389
New header in evmone
yperbasis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,18 +77,15 @@ CallResult EVM::execute(const Transaction& txn, uint64_t gas) noexcept { | |
const bool contract_creation{!txn.to.has_value()}; | ||
const evmc::address destination{contract_creation ? evmc::address{} : *txn.to}; | ||
|
||
evmc_message message{ | ||
contract_creation ? EVMC_CREATE : EVMC_CALL, // kind | ||
0, // flags | ||
0, // depth | ||
static_cast<int64_t>(gas), // gas | ||
destination, // recipient | ||
*txn.from, // sender | ||
&txn.data[0], // input_data | ||
txn.data.size(), // input_size | ||
intx::be::store<evmc::uint256be>(txn.value), // value | ||
{}, // create2_salt | ||
destination, // code_address | ||
const evmc_message message{ | ||
.kind = contract_creation ? EVMC_CREATE : EVMC_CALL, | ||
.gas = static_cast<int64_t>(gas), | ||
.recipient = destination, | ||
.sender = *txn.from, | ||
.input_data = txn.data.data(), | ||
.input_size = txn.data.size(), | ||
.value = intx::be::store<evmc::uint256be>(txn.value), | ||
.code_address = destination, | ||
}; | ||
|
||
evmc::Result res{contract_creation ? create(message) : call(message)}; | ||
|
@@ -146,15 +143,12 @@ evmc::Result EVM::create(const evmc_message& message) noexcept { | |
state_.add_to_balance(contract_addr, value); | ||
|
||
const evmc_message deploy_message{ | ||
EVMC_CALL, // kind | ||
0, // flags | ||
message.depth, // depth | ||
message.gas, // gas | ||
contract_addr, // recipient | ||
message.sender, // sender | ||
nullptr, // input_data | ||
0, // input_size | ||
message.value, // value | ||
.kind = EVMC_CALL, | ||
.depth = message.depth, | ||
.gas = message.gas, | ||
.recipient = contract_addr, | ||
.sender = message.sender, | ||
.value = message.value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👏 |
||
}; | ||
|
||
auto evm_res{execute(deploy_message, ByteView{message.input_data, message.input_size}, /*code_hash=*/nullptr)}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule evmone
updated
from aa921c to ed8a85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👏