-
Notifications
You must be signed in to change notification settings - Fork 314
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
Initcode transaction (TXCREATE) support #702
Conversation
234facf
to
874a0a7
Compare
762f323
to
2662288
Compare
@@ -4,6 +4,7 @@ | |||
|
|||
/// @file | |||
/// Example implementation of an EVMC Host. | |||
/// TODO: Doesn't support TXCREATE transaction 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.
Not sure it makes sense to support it, example.c
only sends EVMC_CALL
message anyway.
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.
feel free to drop the comment like this, if you feel like nothing needs to be done. I was very generous when adding them in
9702dec
to
3a6b2a3
Compare
652c662
to
9bd690a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #702 +/- ##
==========================================
- Coverage 93.49% 93.11% -0.39%
==========================================
Files 25 25
Lines 3861 3878 +17
Branches 396 397 +1
==========================================
+ Hits 3610 3611 +1
- Misses 139 155 +16
Partials 112 112 |
Co-authored-by: pdobacz <[email protected]>
@@ -4,6 +4,7 @@ | |||
|
|||
/// @file | |||
/// Example implementation of an EVMC Host. | |||
/// TODO: Doesn't support TXCREATE transaction 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.
feel free to drop the comment like this, if you feel like nothing needs to be done. I was very generous when adding them in
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 don't want to spoil the party, but I think the simpler API would be to extend the evmc_tx_context
with
hashed_initcode* initcodes;
size_t initcodes_count;
where
struct hashed_initcode {
evmc_bytes32 hash;
const uint8_t* code;
size_t code_size;
};
Indeed simpler but makes problematic:
Neither is maybe big deal but sth to keep in mind. |
I don't think this variant changes much, it only changes where lookup by hash is happening.
For something other than transaction, it will be some other different API? But I think fetch-by-hash is mainly for easier aggregating several transactions (or AA-transactions) into one batch transaction (merging their initcodes without changing TXCREATE instances). I don't think this usecase is in any way affected. |
Anyway I plan to try this in a different PR. |
Makes sense! |
The other approach can be implemented as a "flat map": vector of already sorted (hash, initcode) pairs. EVM only need to read it and can lookup values by binary search. But I'm not insisting on sorting values right now. Linear search should be fine as the start. |
ethereum/evmone@55a7102 |
Replaced by #709 |
Requires #681