-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: revive evm test cases (#2116)
- Loading branch information
Showing
10 changed files
with
162 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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,56 @@ | ||
name: EVM Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
evm-test: | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
~\AppData\Local\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: EVM Test | ||
env: | ||
CGO_CFLAGS: "-O -D__BLST_PORTABLE__" | ||
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__" | ||
ANDROID_HOME: "" # Skip android test | ||
run: | | ||
git submodule update --init --depth 1 --recursive | ||
go mod download | ||
cd tests | ||
sed -i -e 's/\/\/ bt.skipLoad/bt.skipLoad/g' block_test.go | ||
bash -x run-evm-tests.sh |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,67 @@ | ||
From a1fe21e9b999b60705b7310737f2b6bbb680969d Mon Sep 17 00:00:00 2001 | ||
From: buddh0 <[email protected]> | ||
Date: Mon, 8 Jan 2024 17:16:29 +0800 | ||
Subject: [PATCH] diff go-ethereum | ||
|
||
--- | ||
core/vm/contracts.go | 3 --- | ||
core/vm/jump_table.go | 2 +- | ||
params/protocol_params.go | 8 ++++---- | ||
3 files changed, 5 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/core/vm/contracts.go b/core/vm/contracts.go | ||
index 482c020a6..7d9a59a92 100644 | ||
--- a/core/vm/contracts.go | ||
+++ b/core/vm/contracts.go | ||
@@ -78,9 +78,6 @@ var PrecompiledContractsIstanbul = map[common.Address]PrecompiledContract{ | ||
common.BytesToAddress([]byte{7}): &bn256ScalarMulIstanbul{}, | ||
common.BytesToAddress([]byte{8}): &bn256PairingIstanbul{}, | ||
common.BytesToAddress([]byte{9}): &blake2F{}, | ||
- | ||
- common.BytesToAddress([]byte{100}): &tmHeaderValidate{}, | ||
- common.BytesToAddress([]byte{101}): &iavlMerkleProofValidate{}, | ||
} | ||
|
||
var PrecompiledContractsNano = map[common.Address]PrecompiledContract{ | ||
diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go | ||
index 38a0a7653..702b18661 100644 | ||
--- a/core/vm/jump_table.go | ||
+++ b/core/vm/jump_table.go | ||
@@ -90,7 +90,7 @@ func newCancunInstructionSet() JumpTable { | ||
} | ||
|
||
func newShanghaiInstructionSet() JumpTable { | ||
- instructionSet := newLondonInstructionSet() | ||
+ instructionSet := newMergeInstructionSet() | ||
enable3855(&instructionSet) // PUSH0 instruction | ||
enable3860(&instructionSet) // Limit and meter initcode | ||
|
||
diff --git a/params/protocol_params.go b/params/protocol_params.go | ||
index 2b5cf8996..e14a2f414 100644 | ||
--- a/params/protocol_params.go | ||
+++ b/params/protocol_params.go | ||
@@ -19,7 +19,7 @@ package params | ||
import "math/big" | ||
|
||
const ( | ||
- GasLimitBoundDivisor uint64 = 256 // The bound divisor of the gas limit, used in update calculations. | ||
+ GasLimitBoundDivisor uint64 = 1024 // The bound divisor of the gas limit, used in update calculations. | ||
MinGasLimit uint64 = 5000 // Minimum the gas limit may ever be. | ||
MaxGasLimit uint64 = 0x7fffffffffffffff // Maximum the gas limit (2^63-1). | ||
GenesisGasLimit uint64 = 4712388 // Gas limit of the Genesis block. | ||
@@ -122,9 +122,9 @@ const ( | ||
// Introduced in Tangerine Whistle (Eip 150) | ||
CreateBySelfdestructGas uint64 = 25000 | ||
|
||
- DefaultBaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks. | ||
- DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have. | ||
- InitialBaseFee = 0 // Initial base fee for EIP-1559 blocks. | ||
+ DefaultBaseFeeChangeDenominator = 8 // Bounds the amount the base fee can change between blocks. | ||
+ DefaultElasticityMultiplier = 2 // Bounds the maximum gas limit an EIP-1559 block may have. | ||
+ InitialBaseFee = 1000000000 // Initial base fee for EIP-1559 blocks. | ||
|
||
MaxCodeSize = 24576 // Maximum bytecode to permit for a contract | ||
MaxInitCodeSize = 2 * MaxCodeSize // Maximum initcode to permit in a creation transaction and create instructions | ||
-- | ||
2.41.0 | ||
|
This file contains 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
This file contains 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
This file contains 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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd .. | ||
git apply tests/0001-diff-go-ethereum.patch | ||
cd tests | ||
go test -run . -v >test.log | ||
PASS=`cat test.log |grep "PASS:" |wc -l` | ||
cat test.log|grep FAIL > fail.log | ||
FAIL=`cat fail.log |grep "FAIL:" |wc -l` | ||
echo "PASS",$PASS,"FAIL",$FAIL | ||
if [ $FAIL -ne 0 ] | ||
then | ||
cat fail.log | ||
fi |
This file contains 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