-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add EIP: SLOT precompile #9141
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
Merged
+59
−0
Merged
Add EIP: SLOT precompile #9141
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a4d8c1f
initial slot precompile commit
Marchhill 18b5232
reword Encrypted mempools motivation
Marchhill 5cbf03c
eip number & ethmagicians link
Marchhill bc602ec
Merge remote-tracking branch 'upstream/master' into slot-precompile
Marchhill 8f08634
add back renamed file
Marchhill 6d9b5ee
change block number to timestamp
Marchhill 3411ec5
update secuirty considerations
Marchhill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
eip: 7843 | ||
title: SLOT precompile | ||
description: Precompile to get the current slot | ||
author: Marc Harvey-Hill (@Marchhill) | ||
discussions-to: https://ethereum-magicians.org/t/eip-7843-slot-precompile/22234 | ||
status: Draft | ||
type: Standards Track | ||
category: Core | ||
created: 2024-12-06 | ||
--- | ||
|
||
## Abstract | ||
|
||
This EIP proposes to add a new precompile that returns the corresponding slot for the current block. | ||
|
||
## Motivation | ||
|
||
It is currently possible to calculate the slot number from the block timestamp. However, this requires hardcoding the chain slot length into a smart contract. This would require the contract code to be changed in the event of a future change to slot length. A better approach is for the slot number to be calculated by the execution layer and exposed in a precompile. | ||
|
||
### Encrypted Mempools | ||
|
||
This precompile aims to improve support for encrypted mempools. In order to be secure, the validity of encrypted mempool transactions should be tied to the inclusion of all transactions by a proposer in the correct slot. This rule can be enforced by a smart contract using this precompile. | ||
|
||
## Specification | ||
|
||
If `block.number >= TBD` a new precompiled contract `SLOT` shall be created at address `TBD`. | ||
|
||
`SLOT` returns as output the current slot number as an 8 byte ulong in big endian encoding. | ||
|
||
### Gas Cost | ||
|
||
The gas cost for `SLOT` is a fixed fee of `2` | ||
|
||
## Rationale | ||
|
||
### Gas Price | ||
|
||
The precompile is priced to match similar opcodes in the `W_base` set. | ||
|
||
### Precompile | ||
|
||
Making the feature a precompile rather than an opcode gives L2s flexibility to decide whether to implement it. | ||
|
||
## Backwards Compatibility | ||
|
||
No backward compatibility issues found. | ||
|
||
## Test Cases | ||
|
||
N/A | ||
|
||
## Security Considerations | ||
|
||
<!-- TODO --> | ||
Check warning on line 55 in EIPS/eip-7843.md
|
||
Needs discussion. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](../LICENSE.md). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.