-
Notifications
You must be signed in to change notification settings - Fork 513
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
base: cancun
Are you sure you want to change the base?
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 |
@@ -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.
@@ -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)
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$\boldsymbol{\theta}$ (symbol not already used in the paper), in section 6. Transaction Execution.
Screenshot
Updating functions$\Theta$ , $\Lambda$ and $\Xi$
We updated every occurrence of the Message Call function$\boldsymbol{\Theta}$ to incorporate transient storage $\boldsymbol{\theta}$ as the second parameter and new resultant transient storage $\boldsymbol{\theta}'$ as the last returned parameter.
Screenshot
We updated every occurrence of the Create function$\boldsymbol{\Lambda}$ to incorporate transient storage $\boldsymbol{\theta}$ as the second parameter and new resultant transient storage $\boldsymbol{\theta}'$ as the last returned parameter.
Screenshot
We updated every occurrence of the Execution function$\boldsymbol{\Xi}$ to incorporate transient storage $\boldsymbol{\theta}$ as the second parameter and new resultant transient storage $\boldsymbol{\theta}'$ as the second returned parameter.
Screenshot
STATICCALL Exception
We added$\small{TSTORE}$ to the list of forbidden opocodes during a static execution.
Screenshot
Gas cost
We added$\small{TLOAD}$ and $\small{TSTORE}$ to gas opcode categories.
Screenshot
We added a new fee tier for that category.
Screenshot
Finally, we updated the gas cost function$C$ to handle those new opcodes.
Screenshot
Opcodes Definition
We added$\small{TLOAD}$ and $\small{TSTORE}$ to the list of opcodes.
Screenshot