Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 3429f83

Browse files
authored
Update geth dependency from v1.10.18 to v1.11.5 (#1363)
### Description Updates the geth dependency in geth-utils to latest release. Pulled this out from #1361. ### Issue Link Related to #1362. ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ### Contents - Update geth dependency (and ran `go mod tidy` to update sub-dependencies) - Update code bindings to struct changes ### Rationale N/A ### How Has This Been Tested? Using the testing suite in the repo.
1 parent 3aa36a2 commit 3429f83

File tree

6 files changed

+853
-46
lines changed

6 files changed

+853
-46
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Setup golang
4646
uses: actions/setup-go@v3
4747
with:
48-
go-version: ~1.18
48+
go-version: ~1.19
4949
# Go cache for building geth-utils
5050
- name: Go cache
5151
uses: actions/cache@v3

.github/workflows/integration.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
- name: Setup golang
6262
uses: actions/setup-go@v3
6363
with:
64-
go-version: ~1.18
64+
go-version: ~1.19
6565
# Go cache for building geth-utils
6666
- name: Go cache
6767
uses: actions/cache@v3

geth-utils/gethutil/trace.go

+19-17
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ type TraceConfig struct {
124124
LoggerConfig *logger.Config `json:"logger_config"`
125125
}
126126

127+
func newUint64(val uint64) *uint64 { return &val }
128+
127129
func Trace(config TraceConfig) ([]*ExecutionResult, error) {
128130
chainConfig := params.ChainConfig{
129131
ChainID: toBigInt(config.ChainID),
@@ -145,7 +147,7 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
145147

146148
var txsGasLimit uint64
147149
blockGasLimit := toBigInt(config.Block.GasLimit).Uint64()
148-
messages := make([]types.Message, len(config.Transactions))
150+
messages := make([]core.Message, len(config.Transactions))
149151
for i, tx := range config.Transactions {
150152
// If gas price is specified directly, the tx is treated as legacy type.
151153
if tx.GasPrice != nil {
@@ -158,19 +160,19 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
158160
txAccessList[i].Address = accessList.Address
159161
txAccessList[i].StorageKeys = accessList.StorageKeys
160162
}
161-
messages[i] = types.NewMessage(
162-
tx.From,
163-
tx.To,
164-
uint64(tx.Nonce),
165-
toBigInt(tx.Value),
166-
uint64(tx.GasLimit),
167-
toBigInt(tx.GasPrice),
168-
toBigInt(tx.GasFeeCap),
169-
toBigInt(tx.GasTipCap),
170-
tx.CallData,
171-
txAccessList,
172-
false,
173-
)
163+
messages[i] = core.Message{
164+
From: tx.From,
165+
To: tx.To,
166+
Nonce: uint64(tx.Nonce),
167+
Value: toBigInt(tx.Value),
168+
GasLimit: uint64(tx.GasLimit),
169+
GasPrice: toBigInt(tx.GasPrice),
170+
GasFeeCap: toBigInt(tx.GasFeeCap),
171+
GasTipCap: toBigInt(tx.GasTipCap),
172+
Data: tx.CallData,
173+
AccessList: txAccessList,
174+
SkipAccountChecks: false,
175+
}
174176

175177
txsGasLimit += uint64(tx.GasLimit)
176178
}
@@ -191,7 +193,7 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
191193
},
192194
Coinbase: config.Block.Coinbase,
193195
BlockNumber: toBigInt(config.Block.Number),
194-
Time: toBigInt(config.Block.Timestamp),
196+
Time: toBigInt(config.Block.Timestamp).Uint64(),
195197
Difficulty: toBigInt(config.Block.Difficulty),
196198
BaseFee: toBigInt(config.Block.BaseFee),
197199
GasLimit: blockGasLimit,
@@ -215,9 +217,9 @@ func Trace(config TraceConfig) ([]*ExecutionResult, error) {
215217
executionResults := make([]*ExecutionResult, len(config.Transactions))
216218
for i, message := range messages {
217219
tracer := logger.NewStructLogger(config.LoggerConfig)
218-
evm := vm.NewEVM(blockCtx, core.NewEVMTxContext(message), stateDB, &chainConfig, vm.Config{Debug: true, Tracer: tracer, NoBaseFee: true})
220+
evm := vm.NewEVM(blockCtx, core.NewEVMTxContext(&message), stateDB, &chainConfig, vm.Config{Debug: true, Tracer: tracer, NoBaseFee: true})
219221

220-
result, err := core.ApplyMessage(evm, message, new(core.GasPool).AddGas(message.Gas()))
222+
result, err := core.ApplyMessage(evm, &message, new(core.GasPool).AddGas(message.GasLimit))
221223
if err != nil {
222224
return nil, fmt.Errorf("Failed to apply config.Transactions[%d]: %w", i, err)
223225
}

geth-utils/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main
33
go 1.16
44

55
require (
6-
github.com/ethereum/go-ethereum v1.10.18
6+
github.com/ethereum/go-ethereum v1.11.5
77
github.com/holiman/uint256 v1.2.0
88
)
99

0 commit comments

Comments
 (0)