-
Notifications
You must be signed in to change notification settings - Fork 522
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
CANCUN: EIP-1153 Transient Storage #916
Conversation
@yperbasis could you create a |
done |
Thanks! @alexprut @benjaminion @RenanSouza2 @timbeiko @alexkroeger any feedback on that will be highly appreciated as well 🙏 |
Hey, I‘m not sure why I was mentionend but I have two suggestions, the first one is to simplify the section 6.2 to the second one is to use Gwarmaccess in the gas formula instead of creating a new category |
Thanks for your feedback!
|
I have one more suggestion, to move the definition from section 6 (transaction execution) to section 9 (Execution model), this could be integrated in 9.1 (basics), or there could be a revamp and expand the explanation of memory, storage, my previous suggestion was to remove the sentences 'introduced by eip 1153, during the cancun update' and start by 'the transient storage (eip1153)[authors], formally ...' |
From what I understand, section 9 describe thing relative to a single execution context (such as memory, environment, etc...). Structures used for the whole transaction (such as accrued sub-state) are defined in section 6. Since transient storage is created at the beginning of the tx (and destroy at the end) and persist across contexts, I find it more logical to put it in section 6. Thanks again for the feedbacks! |
makes sense, 6.1 is substate and 6.2 is transient storage |
* style: add a missing "be". * style: add a missing "it is". * refactor: clearer sentence
Paper.tex
Outdated
@@ -780,6 +780,27 @@ \subsection{Substate} \label{ch:substate} | |||
\end{equation} | |||
where $\hyperlink{precompiled_set}{\pi}$ is the set of all precompiled addresses. | |||
|
|||
\subsection{Transient Storage} | |||
Introduced by EIP-1153 (\cite{EIP-1153}) during the Cancun update, the transient storage, formally $\boldsymbol{\theta}$, is a volatile version of the world state account storage $\boldsymbol{\sigma}[a]_s$. | |||
It's a mapping between addresses (160-bit identifiers) and storage (another mapping between 256-bit integer values). |
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.
Maybe adding: bi-dimentional
mapping?
No strong opinions, up to you.
Paper.tex
Outdated
@@ -780,6 +780,27 @@ \subsection{Substate} \label{ch:substate} | |||
\end{equation} | |||
where $\hyperlink{precompiled_set}{\pi}$ is the set of all precompiled addresses. | |||
|
|||
\subsection{Transient Storage} | |||
Introduced by EIP-1153 (\cite{EIP-1153}) during the Cancun update, the transient storage, formally $\boldsymbol{\theta}$, is a volatile version of the world state account storage $\boldsymbol{\sigma}[a]_s$. | |||
It's a mapping between addresses (160-bit identifiers) and storage (another mapping between 256-bit integer values). |
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.
The definition of an address is already defined in multiple places, such as formula (97)
, for simplicity maybe the piece (160-bit identifiers)
could be removed.
\end{equation} | ||
where: | ||
\begin{equation} | ||
a \in \mathbb{B}_{160} \quad \wedge \quad k \in \mathbb{B}_{32} \quad \wedge \quad v \in \mathbb{N} |
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.
Same here, a \in \mathbb{B}_{160}
could be moved to formula (97)
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 prefer to leave it there to make the definition more standalone
21ba53a
to
9b9a867
Compare
As suggested by @RenanSouza2 & @alexprut, I've updated the definition paragraph of the Transient storage. @yperbasis Could you have a look when you have some time please, and if everything is ok for you, merge into |
Tagging EIP authors to help review if they want/can 🙏 |
If mentioning that it's cheaper because it never has to be persisted, I might also add that it's also cheaper because it never has to read from the storage trie either since all slots start at zero. Otherwise, looks good! |
@yperbasis If everything is fine for you, could you merge to the |
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.
Please make the following changes:
- In some functions theta is the last return parameter and in others it's the second return parameters. Please make it consistent (probably the second return place is better so that it follows sigma).
- The cost should be defined as G_warmaccess, not independently, since that's how the EIP defines it.
Hey @yperbasis! I totally agree with the requested changes, however changing the order of returns parameters will require to update this part of YP as well (section 6.3.) What do you think? |
@pldespaigne Ah, I see. Then it makes sense to have theta as the last output. But then I'd make it the last output of Xi as well for consistency. |
@yperbasis done! |
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.
LGTM except for the small "finals represents" typo
Done! |
EIP 1153 Transient Storage
This PR translate EIP-1553 into the Yellow Paper.
Here is the PDF version of those changes: Paper.pdf
Definition
We formally define the Transient Storage as (symbol not already used in the paper), in section 6. Transaction Execution.
Screenshot
Updating functions , and
We updated every occurrence of the Message Call function to incorporate transient storage as the second parameter and new resultant transient storage as the last returned parameter.
Screenshot
We updated every occurrence of the Create function to incorporate transient storage as the second parameter and new resultant transient storage as the last returned parameter.
Screenshot
We updated every occurrence of the Execution function to incorporate transient storage as the second parameter and new resultant transient storage as the last returned parameter.
Screenshot
STATICCALL Exception
We added to the list of forbidden opocodes during a static execution.
Screenshot
Gas cost
We added and to gas opcode categories.
Screenshot
We added a new fee tier for that category.
Screenshot
Finally, we updated the gas cost function to handle those new opcodes.
Screenshot
Opcodes Definition
We added and to the list of opcodes.
Screenshot