Skip to content

Commit 742e21c

Browse files
authored
feat(plugins,forks,github): Allow dual-feature (Prague+Cancun) build on EOF releases (#743)
* feat(forks): add PragueEIP7692 * feat(configs): Add PragueEIP7692 * fix(tests): Change EOF tests fork * feat(github): Add evm-impl.yaml config file * fix(github): besu build * fixup configs * feat(plugins/forks): use sets, allow multiple forks from/until * fix(plugins/forks): fixes * feat(tests): EOF - Dual fork name * fix(configs): Skip slow tests in `eip7692-prague` * changelog
1 parent 9ecd0cf commit 742e21c

File tree

10 files changed

+214
-72
lines changed

10 files changed

+214
-72
lines changed

.github/actions/build-besu-evm/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ runs:
3737
run: |
3838
cd $GITHUB_WORKSPACE/besu
3939
./gradlew installDist
40-
echo $GITHUB_WORKSPACE/besu/build/install/besu/bin/evmtool >> $GITHUB_PATH
40+
echo $GITHUB_WORKSPACE/besu/build/install/besu/bin/ >> $GITHUB_PATH

.github/actions/build-evm/action.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ outputs:
1717
value: ${{ steps.config-evm-reader.outputs.ref }}
1818
evm-bin:
1919
description: "Binary name of the evm tool to use"
20-
value: ${{ steps.config-evm-reader.outputs.evm-bin }}
20+
value: ${{ steps.config-evm-impl-config-reader.outputs.evm-bin }}
21+
x-dist:
22+
description: "Binary name of the evm tool to use"
23+
value: ${{ steps.config-evm-impl-config-reader.outputs.x-dist }}
2124
runs:
2225
using: "composite"
2326
steps:
@@ -27,13 +30,20 @@ runs:
2730
run: |
2831
awk "/^${{ inputs.type }}:/{flag=1; next} /^[[:alnum:]]/{flag=0} flag" ./configs/evm.yaml \
2932
| sed 's/ //g' | sed 's/:/=/g' >> "$GITHUB_OUTPUT"
33+
- name: Get the EVM implementation configuration from configs/evm-impl-config.yaml
34+
id: config-evm-impl-config-reader
35+
shell: bash
36+
run: |
37+
awk "/^${{ steps.config-evm-reader.outputs.impl }}:/{flag=1; next} /^[[:alnum:]]/{flag=0} flag" ./configs/evm-impl.yaml \
38+
| sed 's/ //g' | sed 's/:/=/g' >> "$GITHUB_OUTPUT"
3039
- name: Print Variables for the selected EVM type
3140
shell: bash
3241
run: |
3342
echo "Implementation: ${{ steps.config-evm-reader.outputs.impl }}"
3443
echo "Repository: ${{ steps.config-evm-reader.outputs.repo }}"
3544
echo "Reference: ${{ steps.config-evm-reader.outputs.ref }}"
36-
echo "EVM Binary: ${{ steps.config-evm-reader.outputs.evm-bin }}"
45+
echo "EVM Binary: ${{ steps.config-evm-impl-config-reader.outputs.evm-bin }}"
46+
echo "X-Dist parameter: ${{ steps.config-evm-impl-config-reader.outputs.x-dist }}"
3747
- name: Build the EVM using Geth action
3848
if: steps.config-evm-reader.outputs.impl == 'geth'
3949
uses: ./.github/actions/build-geth-evm

.github/actions/build-fixtures/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ runs:
3131
source env/bin/activate
3232
pip install -e .
3333
solc-select use ${{ steps.properties.outputs.solc }} --always-install
34-
fill -n auto --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.name }}.tar.gz --build-name ${{ inputs.name }}
34+
fill -n ${{ steps.evm-builder.outputs.x-dist }} --evm-bin=${{ steps.evm-builder.outputs.evm-bin }} ${{ steps.properties.outputs.fill-params }} --output=fixtures_${{ inputs.name }}.tar.gz --build-name ${{ inputs.name }}
3535
- uses: actions/upload-artifact@v4
3636
with:
3737
name: fixtures_${{ inputs.name }}

configs/evm-impl.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
geth:
2+
evm-bin: evm
3+
x-dist: auto
4+
evmone:
5+
evm-bin: evmone-t8n
6+
x-dist: auto
7+
besu:
8+
evm-bin: evmtool
9+
x-dist: 0

configs/evm.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ stable:
22
impl: geth
33
repo: ethereum/go-ethereum
44
ref: master
5-
evm-bin: evm
65
develop:
76
impl: geth
87
repo: lightclient/go-ethereum
98
ref: prague-devnet-1
10-
evm-bin: evm
119
eip7692:
1210
impl: evmone
1311
repo: ethereum/evmone
1412
ref: master
15-
evm-bin: evmone-t8n
13+
eip7692-prague:
14+
impl: besu
15+
repo: hyperledger/besu
16+
ref: main

configs/feature.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ develop:
99
eip7692:
1010
evm-type: eip7692
1111
fill-params: --fork=CancunEIP7692 ./tests/prague
12+
solc: 0.8.21
13+
eip7692-prague:
14+
evm-type: eip7692-prague
15+
fill-params: --fork=PragueEIP7692 ./tests/prague -k "not slow"
1216
solc: 0.8.21

docs/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Test fixtures for use by clients are available for each release on the [Github r
3030
### 📋 Misc
3131

3232
- ✨ Feature releases can now include multiple types of fixture tarball files from different releases that start with the same prefix ([#736](https://github.com/ethereum/execution-spec-tests/pull/736)).
33+
- ✨ Releases for feature eip7692 now include both Cancun and Prague based tests in the same release, in files `fixtures_eip7692.tar.gz` and `fixtures_eip7692-prague.tar.gz` respectively ([#743](https://github.com/ethereum/execution-spec-tests/pull/743)).
3334

3435
## [v3.0.0](https://github.com/ethereum/execution-spec-tests/releases/tag/v3.0.0) - 2024-07-22
3536

src/ethereum_test_forks/forks/forks.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,3 +709,56 @@ def solc_min_version(cls) -> Version:
709709
Returns the minimum version of solc that supports this fork.
710710
"""
711711
return Version.parse("1.0.0") # set a high version; currently unknown
712+
713+
714+
class PragueEIP7692( # noqa: SC200
715+
Prague,
716+
transition_tool_name="Prague", # Besu enables EOF at Prague
717+
blockchain_test_network_name="Prague", # Besu enables EOF at Prague
718+
solc_name="cancun",
719+
):
720+
"""
721+
Prague + EIP-7692 (EOF) fork
722+
"""
723+
724+
@classmethod
725+
def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCodeType]:
726+
"""
727+
EOF V1 is supported starting from this fork.
728+
"""
729+
return super(PragueEIP7692, cls,).evm_code_types( # noqa: SC200
730+
block_number,
731+
timestamp,
732+
) + [EVMCodeType.EOF_V1]
733+
734+
@classmethod
735+
def call_opcodes(
736+
cls, block_number: int = 0, timestamp: int = 0
737+
) -> List[Tuple[Opcodes, EVMCodeType]]:
738+
"""
739+
EOF V1 introduces EXTCALL, EXTSTATICCALL, EXTDELEGATECALL.
740+
"""
741+
return [
742+
(Opcodes.EXTCALL, EVMCodeType.EOF_V1),
743+
(Opcodes.EXTSTATICCALL, EVMCodeType.EOF_V1),
744+
(Opcodes.EXTDELEGATECALL, EVMCodeType.EOF_V1),
745+
] + super(
746+
PragueEIP7692, cls # noqa: SC200
747+
).call_opcodes(
748+
block_number, timestamp
749+
)
750+
751+
@classmethod
752+
def is_deployed(cls) -> bool:
753+
"""
754+
Flags that the fork has not been deployed to mainnet; it is under active
755+
development.
756+
"""
757+
return False
758+
759+
@classmethod
760+
def solc_min_version(cls) -> Version:
761+
"""
762+
Returns the minimum version of solc that supports this fork.
763+
"""
764+
return Version.parse("1.0.0") # set a high version; currently unknown

0 commit comments

Comments
 (0)