-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 EIP: Introspection precompiles #9028
base: master
Are you sure you want to change the base?
Conversation
File
|
EIPS/eip-introspection.md
Outdated
title: Introspection precompiles | ||
description: Introspection precompiles that expose the current block context to the EVM | ||
author: Brecht Devos (@Brechtpd) | ||
discussions-to: TBD |
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 create a discussions topic in Eth Magicians using the template: https://ethereum-magicians.org/c/eips/5
Co-authored-by: Andrew B Coathup <[email protected]>
The commit 1676c94 (as a parent of 02c9517) contains errors. |
|
||
## Motivation | ||
|
||
The new precompiles aim to enhance introspection capabilities within the EVM, enabling the calculation of the latest chain state offchain at any point in an Ethereum block. This is important to allow general and efficient synchronous composability with L1. Otherwise, to ensure having the latest L1 state, the state would have to be read on L1 and passed in as a separate input. This is expensive and there may be limitations on who can read the state without something like [EIP-2330](https://eips.ethereum.org/EIPS/eip-2330). |
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.
kindly address the bot failures
|
||
## Specification | ||
|
||
If `block.number >= TBD` two new precompiled contracts shall be created: |
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.
we now don't add hardfork number/timestamp information in the EIPs
## Specification | ||
|
||
If `block.number >= TBD` two new precompiled contracts shall be created: | ||
- `TXTRIEROOT` at address `TBD`: This precompile returns the transaction trie root of all transactions in the current block, up to and including the transaction that is currently executing. The tx trie is already calculated for the block header. This EIP just enforces that the trie is constructed incrementally per transaction and exposes the root to the EVM. |
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.
add a html <-- TODO --> tag to be autoflagged at the review PR stage whereever there is TBD in the EIP
## Specification | ||
|
||
If `block.number >= TBD` two new precompiled contracts shall be created: | ||
- `TXTRIEROOT` at address `TBD`: This precompile returns the transaction trie root of all transactions in the current block, up to and including the transaction that is currently executing. The tx trie is already calculated for the block header. This EIP just enforces that the trie is constructed incrementally per transaction and exposes the root to the EVM. |
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.
seems that it would be technically feasible to only compute stateroot till previous tx. kinky confirm that what you wrote is what you intend to propose
|
||
## Rationale | ||
|
||
Simple and efficient access to the latest state of a chain is critical for composability. For synchronous composability, we need to be able to immediately prove all offchain work inside the same block. This makes it impossible to delay the proving to a later block where more information about the current block is available. |
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.
needs some examples where this proposal would be beneficial. rationale is a bit light imo and needs more support and reasoning.
|
||
### Precompile | ||
|
||
Implementing this feature via precompiles instead of opcodes gives L2s flexibility to decide whether to implement it. |
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.
do you mean precompiles vs system contracts? precomplies are sort of an opcode implementation
|
||
## Security Considerations | ||
|
||
Needs discussion. |
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.
add html <-- TODO --> tag here and else where (discussion pending) to be autoflagged at review status update stage
This EIP proposes adding two precompiles that expose the current block context to the EVM