Skip to content

Commit 0ec8e93

Browse files
authored
Merge pull request #381 from OffchainLabs/merge-v1.14.4
Merge v1.14.4
2 parents b487f6f + ebdf83e commit 0ec8e93

File tree

146 files changed

+5551
-3678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+5551
-3678
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ core/ @karalabe @holiman @rjl493456442
1010
eth/ @karalabe @holiman @rjl493456442
1111
eth/catalyst/ @gballet
1212
eth/tracers/ @s1na
13+
core/tracing/ @s1na
1314
graphql/ @s1na
1415
les/ @zsfelfoldi @rjl493456442
1516
light/ @zsfelfoldi @rjl493456442

.github/workflows/go.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
if: false # not supported on OffchainLabs fork, ci.yml is used instead
1313
runs-on: self-hosted
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Set up Go
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v5
1818
with:
1919
go-version: 1.21.4
2020
- name: Run tests

.golangci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ run:
66
# default is true. Enables skipping of directories:
77
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
88
skip-dirs-use-default: true
9-
skip-files:
10-
- core/genesis_alloc.go
119

1210
linters:
1311
disable-all: true
@@ -26,6 +24,8 @@ linters:
2624
- exportloopref
2725
- whitespace
2826

27+
### linters we tried and will not be using:
28+
###
2929
# - structcheck # lots of false positives
3030
# - errcheck #lot of false positives
3131
# - contextcheck
@@ -40,6 +40,8 @@ linters-settings:
4040
simplify: true
4141

4242
issues:
43+
exclude-files:
44+
- core/genesis_alloc.go
4345
exclude-rules:
4446
- path: crypto/bn256/cloudflare/optate.go
4547
linters:

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797

9898
# These builders run the tests
9999
- stage: build
100+
if: type = push
100101
os: linux
101102
arch: amd64
102103
dist: noble
@@ -105,6 +106,7 @@ jobs:
105106
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES
106107

107108
- stage: build
109+
if: type = push
108110
os: linux
109111
dist: noble
110112
go: 1.21.x
@@ -146,5 +148,7 @@ jobs:
146148
os: linux
147149
dist: noble
148150
go: 1.22.x
151+
env:
152+
- racetests
149153
script:
150-
- travis_wait 50 go run build/ci.go test -race $TEST_PACKAGES
154+
- travis_wait 60 go run build/ci.go test -race $TEST_PACKAGES

Makefile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,43 @@
22
# with Go source code. If you know what GOPATH is then you probably
33
# don't need to bother with make.
44

5-
.PHONY: geth all test lint clean devtools help
5+
.PHONY: geth all test lint fmt clean devtools help
66

77
GOBIN = ./build/bin
88
GO ?= latest
99
GORUN = go run
1010

11-
#? geth: Build geth
11+
#? geth: Build geth.
1212
geth:
1313
$(GORUN) build/ci.go install ./cmd/geth
1414
@echo "Done building."
1515
@echo "Run \"$(GOBIN)/geth\" to launch geth."
1616

17-
#? all: Build all packages and executables
17+
#? all: Build all packages and executables.
1818
all:
1919
$(GORUN) build/ci.go install
2020

21-
#? test: Run the tests
21+
#? test: Run the tests.
2222
test: all
2323
$(GORUN) build/ci.go test
2424

25-
#? lint: Run certain pre-selected linters
25+
#? lint: Run certain pre-selected linters.
2626
lint: ## Run linters.
2727
$(GORUN) build/ci.go lint
2828

29-
#? clean: Clean go cache, built executables, and the auto generated folder
29+
#? fmt: Ensure consistent code formatting.
30+
fmt:
31+
gofmt -s -w $(shell find . -name "*.go")
32+
33+
#? clean: Clean go cache, built executables, and the auto generated folder.
3034
clean:
3135
go clean -cache
3236
rm -fr build/_workspace/pkg/ $(GOBIN)/*
3337

3438
# The devtools target installs tools required for 'go generate'.
3539
# You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
3640

37-
#? devtools: Install recommended developer tools
41+
#? devtools: Install recommended developer tools.
3842
devtools:
3943
env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
4044
env GOBIN= go install github.com/fjl/gencodec@latest
@@ -45,5 +49,9 @@ devtools:
4549

4650
#? help: Get more info on make commands.
4751
help: Makefile
48-
@echo " Choose a command run in go-ethereum:"
52+
@echo ''
53+
@echo 'Usage:'
54+
@echo ' make [target]'
55+
@echo ''
56+
@echo 'Targets:'
4957
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'

accounts/keystore/account_cache_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,11 @@ func TestUpdatedKeyfileContents(t *testing.T) {
326326

327327
// Create a temporary keystore to test with
328328
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-updatedkeyfilecontents-test-%d-%d", os.Getpid(), rand.Int()))
329+
330+
// Create the directory
331+
os.MkdirAll(dir, 0700)
332+
defer os.RemoveAll(dir)
333+
329334
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
330335

331336
list := ks.Accounts()
@@ -335,9 +340,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
335340
if !waitWatcherStart(ks) {
336341
t.Fatal("keystore watcher didn't start in time")
337342
}
338-
// Create the directory and copy a key file into it.
339-
os.MkdirAll(dir, 0700)
340-
defer os.RemoveAll(dir)
343+
// Copy a key file into it
341344
file := filepath.Join(dir, "aaa")
342345

343346
// Place one of our testfiles in there

arbitrum/recordingdb.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ type RecordingKV struct {
3232
inner *triedb.Database
3333
diskDb ethdb.KeyValueStore
3434
readDbEntries map[common.Hash][]byte
35+
mutex sync.Mutex
3536
enableBypass bool
3637
}
3738

3839
func newRecordingKV(inner *triedb.Database, diskDb ethdb.KeyValueStore) *RecordingKV {
39-
return &RecordingKV{inner, diskDb, make(map[common.Hash][]byte), false}
40+
return &RecordingKV{inner, diskDb, make(map[common.Hash][]byte), sync.Mutex{}, false}
4041
}
4142

4243
func (db *RecordingKV) Has(key []byte) (bool, error) {
4344
return false, errors.New("recording KV doesn't support Has")
4445
}
4546

47+
// Get may be called concurrently with other Get calls
4648
func (db *RecordingKV) Get(key []byte) ([]byte, error) {
4749
var hash common.Hash
4850
var res []byte
@@ -66,6 +68,8 @@ func (db *RecordingKV) Get(key []byte) ([]byte, error) {
6668
if crypto.Keccak256Hash(res) != hash {
6769
return nil, fmt.Errorf("recording KV attempted to access non-hash key %v", hash)
6870
}
71+
db.mutex.Lock()
72+
defer db.mutex.Unlock()
6973
db.readDbEntries[hash] = res
7074
return res, nil
7175
}
@@ -190,7 +194,7 @@ func (r *RecordingDatabase) StateFor(header *types.Header) (*state.StateDB, erro
190194
r.mutex.Lock()
191195
defer r.mutex.Unlock()
192196

193-
sdb, err := state.NewDeterministic(header.Root, r.db)
197+
sdb, err := state.NewRecording(header.Root, r.db)
194198
if err == nil {
195199
r.referenceRootLockHeld(header.Root)
196200
}
@@ -263,7 +267,7 @@ func (r *RecordingDatabase) PrepareRecording(ctx context.Context, lastBlockHeade
263267
if lastBlockHeader != nil {
264268
prevRoot = lastBlockHeader.Root
265269
}
266-
recordingStateDb, err := state.NewDeterministic(prevRoot, recordingStateDatabase)
270+
recordingStateDb, err := state.NewRecording(prevRoot, recordingStateDatabase)
267271
if err != nil {
268272
return nil, nil, nil, fmt.Errorf("failed to create recordingStateDb: %w", err)
269273
}

beacon/engine/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
209209
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
210210
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
211211
}
212-
var blobHashes []common.Hash
212+
var blobHashes = make([]common.Hash, 0, len(txs))
213213
for _, tx := range txs {
214214
blobHashes = append(blobHashes, tx.BlobHashes()...)
215215
}

beacon/light/sync/head_sync_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func TestValidatedHead(t *testing.T) {
9191
ts.ServerEvent(EvNewOptimisticUpdate, testServer3, testOptUpdate4)
9292
// finality should be requested from both servers
9393
ts.Run(4, testServer1, ReqFinality{}, testServer3, ReqFinality{})
94-
// future period annonced heads should be queued
94+
// future period announced heads should be queued
9595
ht.ExpValidated(t, 4, nil)
9696

9797
chain.SetNextSyncPeriod(2)

beacon/types/exec_payload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func convertPayload[T payloadType](payload T, parentRoot *zrntcommon.Root) (*typ
6565

6666
block := types.NewBlockWithHeader(&header).WithBody(types.Body{Transactions: transactions, Withdrawals: withdrawals})
6767
if hash := block.Hash(); hash != expectedHash {
68-
return nil, fmt.Errorf("Sanity check failed, payload hash does not match (expected %x, got %x)", expectedHash, hash)
68+
return nil, fmt.Errorf("sanity check failed, payload hash does not match (expected %x, got %x)", expectedHash, hash)
6969
}
7070
return block, nil
7171
}

0 commit comments

Comments
 (0)