-
Notifications
You must be signed in to change notification settings - Fork 391
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
Implement TLOAD and TSTORE #1233
Conversation
eb8bf52
to
8a80e02
Compare
5ee85ee
to
8b95ad3
Compare
// removed rwc_inner_chunk here... does that matter? | ||
self.transient_storage.push(Operation::new(rwc, rw, op)); | ||
OperationRef::from((Target::TransientStorage, self.transient_storage.len() - 1)) | ||
} |
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.
better to keep rwc check. (the rwc check is used for early terminate, to avoid rws cost too much memory to make l2geth down. while for tload/tstore, the 100 gas cost is non trivial, you cannot create too many tload/tstores. Anyway, keeping rwc_check makes code more consistent.)
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.
fixed in latest commit
@@ -581,6 +599,8 @@ impl Rw { | |||
Self::Memory { .. } => RwTableTag::Memory, | |||
Self::Stack { .. } => RwTableTag::Stack, | |||
Self::AccountStorage { .. } => RwTableTag::AccountStorage, | |||
// TODO: pick one! | |||
Self::AccountTransientStorage { .. } => RwTableTag::TransientStorage, |
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.
what is this todo?
// state.stack_read(&mut exec_step, value_stack_position, value)?; | ||
|
||
let (_, value_prev) = state.sdb.get_transient_storage(&contract_addr, &key); | ||
let value_prev = *value_prev; |
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.
why we need value_prev? (SSTORE needs value_prev since it is related to gas cost)
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.
oh revert.
i think you forget to modify |
I have added the changes by @lispc |
Description
[PR description]
Issue Link
[link issue here]
Type of change
Contents
Rationale
[design decisions and extended information]
How Has This Been Tested?
[explanation]
How to fill a PR description
Please give a concise description of your PR.
The target readers could be future developers, reviewers, and auditors. By reading your description, they should easily understand the changes proposed in this pull request.
MUST: Reference the issue to resolve
Single responsability
Is RECOMMENDED to create single responsibility commits, but not mandatory.
Anyway, you MUST enumerate the changes in a unitary way, e.g.
Design choices
RECOMMENDED to: