Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Brechtpd
Copy link

@Brechtpd Brechtpd commented Nov 9, 2024

This EIP proposes adding two precompiles that expose the current block context to the EVM

@Brechtpd Brechtpd requested a review from eth-bot as a code owner November 9, 2024 14:47
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels Nov 9, 2024
@eth-bot
Copy link
Collaborator

eth-bot commented Nov 9, 2024

File EIPS/eip-7814.md

Requires 1 more reviewers from @g11tech, @lightclient, @SamWilsn

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Nov 9, 2024
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Nov 9, 2024
EIPS/eip-introspection.md Outdated Show resolved Hide resolved
title: Introspection precompiles
description: Introspection precompiles that expose the current block context to the EVM
author: Brecht Devos (@Brechtpd)
discussions-to: TBD
Copy link
Contributor

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

Copy link

The commit 1676c94 (as a parent of 02c9517) contains errors.
Please inspect the Run Summary for details.


## 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).
Copy link
Contributor

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:
Copy link
Contributor

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.
Copy link
Contributor

@g11tech g11tech Jan 28, 2025

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-core w-ci Waiting on CI to pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants