From a4d8c1f80d5573cf4ab38b1fa62c0e604b9fd6b0 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Mon, 9 Dec 2024 14:35:56 +1100 Subject: [PATCH 1/6] initial slot precompile commit --- EIPS/eip-slot-precompile.md | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 EIPS/eip-slot-precompile.md diff --git a/EIPS/eip-slot-precompile.md b/EIPS/eip-slot-precompile.md new file mode 100644 index 00000000000000..72a322508c236c --- /dev/null +++ b/EIPS/eip-slot-precompile.md @@ -0,0 +1,60 @@ +--- +eip: +title: SLOT precompile +description: Precompile to get the current slot +author: Marc Harvey-Hill (@Marchhill) +discussions-to: +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 + +Like [EIP-7793](), 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. + +## 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 + + +Needs discussion. + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). From 18b5232a2af10e8ac0b8cfd797ef85d09e81ec60 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Mon, 16 Dec 2024 19:12:33 +1100 Subject: [PATCH 2/6] reword Encrypted mempools motivation --- EIPS/eip-slot-precompile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-slot-precompile.md b/EIPS/eip-slot-precompile.md index 72a322508c236c..e3567d5a268f1c 100644 --- a/EIPS/eip-slot-precompile.md +++ b/EIPS/eip-slot-precompile.md @@ -20,7 +20,7 @@ It is currently possible to calculate the slot number from the block timestamp. ### Encrypted Mempools -Like [EIP-7793](), 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. +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 From 5cbf03cc5a2e8e0579da8a9a661994b4ed219cc8 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Tue, 17 Dec 2024 23:11:46 +1100 Subject: [PATCH 3/6] eip number & ethmagicians link --- EIPS/eip-slot-precompile.md | 60 ------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 EIPS/eip-slot-precompile.md diff --git a/EIPS/eip-slot-precompile.md b/EIPS/eip-slot-precompile.md deleted file mode 100644 index e3567d5a268f1c..00000000000000 --- a/EIPS/eip-slot-precompile.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -eip: -title: SLOT precompile -description: Precompile to get the current slot -author: Marc Harvey-Hill (@Marchhill) -discussions-to: -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 - - -Needs discussion. - -## Copyright - -Copyright and related rights waived via [CC0](../LICENSE.md). From 8f086347886c6dfe90c6ed7f92d67342a8fe38f0 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Wed, 18 Dec 2024 00:56:57 +1100 Subject: [PATCH 4/6] add back renamed file --- EIPS/eip-7843.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 EIPS/eip-7843.md diff --git a/EIPS/eip-7843.md b/EIPS/eip-7843.md new file mode 100644 index 00000000000000..dff7ca634a3096 --- /dev/null +++ b/EIPS/eip-7843.md @@ -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 + + +Needs discussion. + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). From 6d9b5ee17dd7f747bcebb74e0e4b3acef709b7c1 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Thu, 19 Dec 2024 01:06:49 +0800 Subject: [PATCH 5/6] change block number to timestamp --- EIPS/eip-7843.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-7843.md b/EIPS/eip-7843.md index dff7ca634a3096..b2d8a68b0c66a7 100644 --- a/EIPS/eip-7843.md +++ b/EIPS/eip-7843.md @@ -24,7 +24,7 @@ This precompile aims to improve support for encrypted mempools. In order to be s ## Specification -If `block.number >= TBD` a new precompiled contract `SLOT` shall be created at address `TBD`. +If `block.timestamp >= 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. From 3411ec56854407790d3c588871f78c9b189321b6 Mon Sep 17 00:00:00 2001 From: Marc Harvey-Hill Date: Thu, 19 Dec 2024 11:55:09 +0800 Subject: [PATCH 6/6] update secuirty considerations --- EIPS/eip-7843.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EIPS/eip-7843.md b/EIPS/eip-7843.md index b2d8a68b0c66a7..9b15913b45ad71 100644 --- a/EIPS/eip-7843.md +++ b/EIPS/eip-7843.md @@ -52,8 +52,7 @@ N/A ## Security Considerations - -Needs discussion. +None. ## Copyright