-
Notifications
You must be signed in to change notification settings - Fork 7
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 transient hostios #15
base: testnet-2
Are you sure you want to change the base?
Conversation
include/hostio.h
Outdated
@@ -36,7 +36,7 @@ VM_HOOK(account_codehash) void account_codehash(const uint8_t * address, uint8_t | |||
* that of the EVM. This means that, under the hood, this hostio is accessing the 32-byte | |||
* value stored in the EVM state trie at offset `key`, which will be `0` when not previously | |||
* set. The semantics, then, are equivalent to that of the EVM's [`SLOAD`] opcode. | |||
* |
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.
Let's re-add these, since they're the way the blocks are currently formatted
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.
👍
* | ||
* [`TLOAD`]: https://www.evm.codes/#5c | ||
*/ | ||
VM_HOOK(transient_load_bytes32) void transient_load_bytes32(const uint8_t * key, uint8_t * dest); |
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.
As we discussed on slack, let's rename these.
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.
👍
include/hostio.h
Outdated
* the EVM transient storage at offset `key`. Furthermore, refunds are tabulated exactly as in the | ||
* EVM. The semantics, then, are equivalent to that of the EVM's [`TSTORE`] opcode. | ||
* | ||
* [`TSTORE`]: https://www.evm.codes/#5d |
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.
Let's link the following for now since these opcodes don't yet exist
https://eips.ethereum.org/EIPS/eip-1153
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.
👍
include/storage.h
Outdated
/** | ||
* transient_load / store load or store a value from transient storage accordingly. | ||
* | ||
* The value of the first "storage" pointer is not used. | ||
* generated headers provide: | ||
* a const storage pointer when working for a view-only function | ||
* a non const pointer for a mutating function | ||
* no pointer (so don't call transient_load) for a pure function | ||
* | ||
*/ | ||
inline void transient_load(const void* storage, const uint8_t *key, uint8_t *dest) { | ||
transient_load_bytes32(key, dest); | ||
} | ||
|
||
/** | ||
* see documentation for transient_load | ||
*/ | ||
inline void transient_store(void *storage, const uint8_t *key, const uint8_t *value) { | ||
transient_store_bytes32(key, value); | ||
} | ||
|
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.
Let's drop these for now, since we're not yet supporting higher-order affordances
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.
👍
No description provided.