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

Upgrade geth to v1.14 #1118

Merged
merged 26 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ pipeline {
steps {
sh "mkdir -p ${TRACEDIR}"
sh "rm -rf ${TRACEDIR}/*"
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') {
sh "build/aida-sdb record --cpu-profile cpu-profile-0.dat --trace-file ${TRACEDIR}/trace-0.dat ${AIDADB} ${FROMBLOCK} ${FROMBLOCK}+1000"
sh "build/aida-sdb record --cpu-profile cpu-profile-1.dat --trace-file ${TRACEDIR}/trace-1.dat ${AIDADB} ${FROMBLOCK}+1001 ${FROMBLOCK}+2000"
sh "build/aida-sdb record --cpu-profile cpu-profile-2.dat --trace-file ${TRACEDIR}/trace-2.dat ${AIDADB} ${FROMBLOCK}+2001 ${TOBLOCK}"
}
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') {
// sh "build/aida-sdb record --cpu-profile cpu-profile-0.dat --trace-file ${TRACEDIR}/trace-0.dat ${AIDADB} ${FROMBLOCK} ${FROMBLOCK}+1000"
// sh "build/aida-sdb record --cpu-profile cpu-profile-1.dat --trace-file ${TRACEDIR}/trace-1.dat ${AIDADB} ${FROMBLOCK}+1001 ${FROMBLOCK}+2000"
// sh "build/aida-sdb record --cpu-profile cpu-profile-2.dat --trace-file ${TRACEDIR}/trace-2.dat ${AIDADB} ${FROMBLOCK}+2001 ${TOBLOCK}"
// }
}
}

stage('aida-sdb replay') {
steps {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') {
sh "build/aida-sdb replay ${VM} ${STORAGE} ${TMPDB} ${AIDADB} ${PRIME} --shadow-db --db-shadow-impl geth --cpu-profile cpu-profile.dat --memory-profile mem-profile.dat --memory-breakdown --trace-file ${TRACEDIR}/trace-0.dat ${FROMBLOCK} ${TOBLOCK}"
sh "build/aida-sdb replay ${VM} ${STORAGE} ${TMPDB} ${AIDADB} ${PRIME} --cpu-profile cpu-profile.dat --memory-profile mem-profile.dat --memory-breakdown --trace-dir ${TRACEDIR} ${FROMBLOCK} ${TOBLOCK}"
}
// catchError(buildResult: 'FAILURE', stageResult: 'FAILURE', message: 'Test Suite had a failure') {
// sh "build/aida-sdb replay ${VM} ${STORAGE} ${TMPDB} ${AIDADB} ${PRIME} --shadow-db --db-shadow-impl geth --cpu-profile cpu-profile.dat --memory-profile mem-profile.dat --memory-breakdown --trace-file ${TRACEDIR}/trace-0.dat ${FROMBLOCK} ${TOBLOCK}"
// sh "build/aida-sdb replay ${VM} ${STORAGE} ${TMPDB} ${AIDADB} ${PRIME} --cpu-profile cpu-profile.dat --memory-profile mem-profile.dat --memory-breakdown --trace-dir ${TRACEDIR} ${FROMBLOCK} ${TOBLOCK}"
// }
sh "rm -rf ${TRACEDIR}"
}
}
Expand Down
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,43 @@ tosca:

aida-rpc: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-rpc \
./cmd/aida-rpc

aida-stochastic-sdb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-stochastic-sdb \
./cmd/aida-stochastic-sdb

aida-vm-adb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-vm-adb \
./cmd/aida-vm-adb

aida-vm-sdb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
CGO_CFLAGS="-g -O2 -DMDBX_FORCE_ASSERTIONS=1 -Wno-error=strict-prototypes" \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-vm-sdb \
./cmd/aida-vm-sdb

aida-vm: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-vm \
./cmd/aida-vm

aida-sdb: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-sdb \
./cmd/aida-sdb

aida-profile: carmen tosca
GOPROXY=$(GOPROXY) \
GOPRIVATE=github.com/Fantom-foundation/Carmen,github.com/Fantom-foundation/Sonic \
CGO_CFLAGS="-g -O2 -DMDBX_FORCE_ASSERTIONS=1 -Wno-error=strict-prototypes" \
go build -ldflags "-s -w -X 'github.com/Fantom-foundation/Aida/utils.GitCommit=$(BUILD_COMMIT)'" \
-o $(GO_BIN)/aida-profile \
Expand Down
16 changes: 8 additions & 8 deletions cmd/aida-rpc/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"encoding/json"
"math/big"
"strings"
"testing"

Expand All @@ -28,6 +27,7 @@ import (
"github.com/Fantom-foundation/Aida/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/holiman/uint256"
"go.uber.org/mock/gomock"
)

Expand Down Expand Up @@ -70,13 +70,13 @@ func TestRpc_AllDbEventsAreIssuedInOrder_Sequential(t *testing.T) {
// Req 1
db.EXPECT().GetArchiveState(uint64(2)).Return(archiveOne, nil),
archiveOne.EXPECT().BeginTransaction(uint32(1)),
archiveOne.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(1)),
archiveOne.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(1)),
archiveOne.EXPECT().EndTransaction(),
archiveOne.EXPECT().Release(),
// Req 2
db.EXPECT().GetArchiveState(uint64(2)).Return(archiveTwo, nil),
archiveTwo.EXPECT().BeginTransaction(uint32(2)),
archiveTwo.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(1)),
archiveTwo.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(1)),
archiveTwo.EXPECT().EndTransaction(),
archiveTwo.EXPECT().Release(),
// Req 3
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestRpc_AllDbEventsAreIssuedInOrder_Parallel(t *testing.T) {
// Req 1
db.EXPECT().GetArchiveState(uint64(2)).Return(archiveOne, nil),
archiveOne.EXPECT().BeginTransaction(uint32(1)),
archiveOne.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(1)),
archiveOne.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(1)),
archiveOne.EXPECT().EndTransaction(),
archiveOne.EXPECT().Release(),
)
Expand Down Expand Up @@ -354,7 +354,7 @@ func TestRpc_ValidationDoesNotFailOnValidTransaction_Sequential(t *testing.T) {
gomock.InOrder(
db.EXPECT().GetArchiveState(uint64(2)).Return(archive, nil),
archive.EXPECT().BeginTransaction(uint32(1)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(1)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(1)),
archive.EXPECT().EndTransaction(),
archive.EXPECT().Release(),
)
Expand Down Expand Up @@ -396,7 +396,7 @@ func TestRpc_ValidationDoesNotFailOnValidTransaction_Parallel(t *testing.T) {
gomock.InOrder(
db.EXPECT().GetArchiveState(uint64(2)).Return(archive, nil),
archive.EXPECT().BeginTransaction(uint32(1)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(1)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(1)),
archive.EXPECT().EndTransaction(),
archive.EXPECT().Release(),
)
Expand Down Expand Up @@ -438,7 +438,7 @@ func TestRpc_ValidationFailsOnValidTransaction_Sequential(t *testing.T) {
gomock.InOrder(
db.EXPECT().GetArchiveState(uint64(2)).Return(archive, nil),
archive.EXPECT().BeginTransaction(uint32(1)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(2)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(2)),
archive.EXPECT().EndTransaction(),
archive.EXPECT().Release(),
)
Expand Down Expand Up @@ -484,7 +484,7 @@ func TestRpc_ValidationFailsOnValidTransaction_Parallel(t *testing.T) {
gomock.InOrder(
db.EXPECT().GetArchiveState(uint64(2)).Return(archive, nil),
archive.EXPECT().BeginTransaction(uint32(1)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(big.Int).SetInt64(2)),
archive.EXPECT().GetBalance(common.HexToAddress(testingAddress)).Return(new(uint256.Int).SetUint64(2)),
archive.EXPECT().EndTransaction(),
archive.EXPECT().Release(),
)
Expand Down
2 changes: 0 additions & 2 deletions cmd/aida-sdb/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/Fantom-foundation/Aida/txcontext"
"github.com/Fantom-foundation/Aida/utils"
"github.com/Fantom-foundation/Substate/db"
"github.com/ethereum/go-ethereum/core/state"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -66,7 +65,6 @@ func RecordStateDbTrace(ctx *cli.Context) error {
// force enable transaction validation
cfg.ValidateTxState = true

state.EnableRecordReplay()
aidaDb, err := db.NewReadOnlyBaseDB(cfg.AidaDb)
if err != nil {
return fmt.Errorf("cannot open aida-db; %w", err)
Expand Down
2 changes: 0 additions & 2 deletions cmd/aida-stochastic-sdb/stochastic/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
substatecontext "github.com/Fantom-foundation/Aida/txcontext/substate"
"github.com/Fantom-foundation/Aida/utils"
"github.com/Fantom-foundation/Substate/db"
gethstate "github.com/ethereum/go-ethereum/core/state"
"github.com/urfave/cli/v2"
)

Expand Down Expand Up @@ -58,7 +57,6 @@ last block for recording events.`,

// stochasticRecordAction implements recording of events.
func stochasticRecordAction(ctx *cli.Context) error {
gethstate.EnableRecordReplay()
var err error

cfg, err := utils.NewConfig(ctx, utils.BlockRangeArgs)
Expand Down
Loading
Loading