Skip to content

Commit

Permalink
Merge tag 'v1.15.3' into gk/geth-v1.15.3-rewritten
Browse files Browse the repository at this point in the history
  • Loading branch information
geoknee committed Mar 3, 2025
2 parents e136827 + 612c9e0 commit cca9ecc
Show file tree
Hide file tree
Showing 105 changed files with 1,357 additions and 1,711 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ linters:
- gocheckcompilerdirectives
- reassign
- mirror
- tenv
- usetesting
### linters we tried and will not be using:
###
# - structcheck # lots of false positives
Expand Down
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
os: linux
arch: amd64
dist: focal
go: 1.23.x
go: 1.24.x
env:
- docker
services:
Expand All @@ -33,7 +33,7 @@ jobs:
os: linux
dist: focal
sudo: required
go: 1.23.x
go: 1.24.x
env:
- azure-linux
git:
Expand Down Expand Up @@ -85,15 +85,15 @@ jobs:
os: linux
arch: amd64
dist: focal
go: 1.23.x
go: 1.24.x
script:
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES

- stage: build
if: type = push
os: linux
dist: focal
go: 1.22.x
go: 1.23.x
script:
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES

Expand All @@ -102,7 +102,7 @@ jobs:
if: type = cron || (type = push && tag ~= /^v[0-9]/)
os: linux
dist: focal
go: 1.23.x
go: 1.24.x
env:
- ubuntu-ppa
git:
Expand All @@ -118,7 +118,7 @@ jobs:
if: type = cron
os: linux
dist: focal
go: 1.23.x
go: 1.24.x
env:
- azure-purge
git:
Expand All @@ -131,7 +131,7 @@ jobs:
if: type = cron
os: linux
dist: focal
go: 1.23.x
go: 1.24.x
env:
- racetests
script:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.23-alpine AS builder
FROM golang:1.24-alpine AS builder

RUN apk add --no-cache gcc musl-dev linux-headers git

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.23-alpine AS builder
FROM golang:1.24-alpine AS builder

RUN apk add --no-cache gcc musl-dev linux-headers git

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ archives are published at https://geth.ethereum.org/downloads/.

For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/getting-started/installing-geth).

Building `geth` requires both a Go (version 1.22 or later) and a C compiler. You can install
Building `geth` requires both a Go (version 1.23 or later) and a C compiler. You can install
them using your favourite package manager. Once the dependencies are installed, run

```shell
Expand Down
173 changes: 100 additions & 73 deletions build/checksums.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/clef/intapi_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type Account struct {
> Notifications are not confirmable by definition, since they do not have a Response object to be returned. As such, the Client would not be aware of any errors (like e.g. "Invalid params","Internal error"
### 3.1.0

* Add `ContentType` `string` to `SignDataRequest` to accommodate the latest EIP-191 and EIP-712 implementations.
* Add `ContentType` `string` to `SignDataRequest` to accommodate the latest [EIP-191](https://eips.ethereum.org/EIPS/eip-191) and [EIP-712](https://eips.ethereum.org/EIPS/eip-712) implementations.

### 3.0.0

Expand Down
8 changes: 1 addition & 7 deletions cmd/clef/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,7 @@ func TestMain(m *testing.M) {
// This method creates a temporary keystore folder which will be removed after
// the test exits.
func runClef(t *testing.T, args ...string) *testproc {
ddir, err := os.MkdirTemp("", "cleftest-*")
if err != nil {
return nil
}
t.Cleanup(func() {
os.RemoveAll(ddir)
})
ddir := t.TempDir()
return runWithKeystore(t, ddir, args...)
}

Expand Down
3 changes: 0 additions & 3 deletions cmd/devp2p/internal/ethtest/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,6 @@ loop:
return fmt.Errorf("wrong head block in status, want: %#x (block %d) have %#x",
want, chain.blocks[chain.Len()-1].NumberU64(), have)
}
if have, want := msg.TD.Cmp(chain.TD()), 0; have != want {
return fmt.Errorf("wrong TD in status: have %v want %v", have, want)
}
if have, want := msg.ForkID, chain.ForkID(); !reflect.DeepEqual(have, want) {
return fmt.Errorf("wrong fork ID in status: have %v, want %v", have, want)
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,

// Set the receipt logs and create the bloom filter.
receipt.Logs = statedb.GetLogs(tx.Hash(), vmContext.BlockNumber.Uint64(), blockHash)
receipt.Bloom = types.CreateBloom(types.Receipts{receipt})
receipt.Bloom = types.CreateBloom(receipt)

// These three are non-consensus fields:
//receipt.BlockHash
//receipt.BlockNumber
Expand Down Expand Up @@ -380,7 +381,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
StateRoot: root,
TxRoot: types.DeriveSha(includedTxs, trie.NewStackTrie(nil)),
ReceiptRoot: types.DeriveSha(receipts, trie.NewStackTrie(nil)),
Bloom: types.CreateBloom(receipts),
Bloom: types.MergeBloom(receipts),
LogsHash: rlpHash(statedb.Logs()),
Receipts: receipts,
Rejected: rejectedTxs,
Expand Down
3 changes: 2 additions & 1 deletion cmd/evm/testdata/evmrun/3.out.1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"root": "b444481d1367188172f8c6091e948aaa68bae763fd26d6b9e994306a66bf69f9",
"accounts": {
"pre(0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142)": {
"0x0000000000000000000000007265636569766572": {
"balance": "0",
"nonce": 0,
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"codeHash": "0x3e48ef54b89079a075f3b8fc253c657a86b110a7aed3568c1517b10edf2c3eb6",
"code": "0x6040",
"address": "0x0000000000000000000000007265636569766572",
"key": "0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142"
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/evm/testdata/evmrun/4.out.1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"root": "b444481d1367188172f8c6091e948aaa68bae763fd26d6b9e994306a66bf69f9",
"accounts": {
"pre(0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142)": {
"0x0000000000000000000000007265636569766572": {
"balance": "0",
"nonce": 0,
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"codeHash": "0x3e48ef54b89079a075f3b8fc253c657a86b110a7aed3568c1517b10edf2c3eb6",
"code": "0x6040",
"address": "0x0000000000000000000000007265636569766572",
"key": "0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142"
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ var (
}
StateHistoryFlag = &cli.Uint64Flag{
Name: "history.state",
Usage: "Number of recent blocks to retain state history for (default = 90,000 blocks, 0 = entire chain)",
Usage: "Number of recent blocks to retain state history for, only relevant in state.scheme=path (default = 90,000 blocks, 0 = entire chain)",
Value: ethconfig.Defaults.StateHistory,
Category: flags.StateCategory,
}
Expand Down
6 changes: 1 addition & 5 deletions cmd/utils/history_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ func TestHistoryImportAndExport(t *testing.T) {
}

// Make temp directory for era files.
dir, err := os.MkdirTemp("", "history-export-test")
if err != nil {
t.Fatalf("error creating temp test directory: %v", err)
}
defer os.RemoveAll(dir)
dir := t.TempDir()

// Export history to temp directory.
if err := ExportHistory(chain, dir, 0, count, step); err != nil {
Expand Down
40 changes: 14 additions & 26 deletions consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ var (
// engine implements the consensus interface (except the beacon itself).
type Beacon struct {
// For migrated OP chains (OP mainnet, OP Goerli), ethone is a dummy legacy pre-Bedrock consensus
ethone consensus.Engine // Original consensus engine used in eth1, e.g. ethash or clique
ttdblock *uint64 // Merge block-number for testchain generation without TTDs
ethone consensus.Engine // Original consensus engine used in eth1, e.g. ethash or clique
}

// New creates a consensus engine with the given embedded eth1 engine.
Expand All @@ -74,16 +73,16 @@ func New(ethone consensus.Engine) *Beacon {
return &Beacon{ethone: ethone}
}

// TestingTTDBlock is a replacement mechanism for TTD-based pre-/post-merge
// splitting. With chain history deletion, TD calculations become impossible.
// This is fine for progressing the live chain, but to be able to generate test
// chains, we do need a split point. This method supports setting an explicit
// block number to use as the splitter *for testing*, instead of having to keep
// the notion of TDs in the client just for testing.
//
// The block with supplied number is regarded as the last pre-merge block.
func (beacon *Beacon) TestingTTDBlock(number uint64) {
beacon.ttdblock = &number
// isPostMerge reports whether the given block number is assumed to be post-merge.
// Here we check the MergeNetsplitBlock to allow configuring networks with a PoW or
// PoA chain for unit testing purposes.
func isPostMerge(config *params.ChainConfig, blockNum uint64, timestamp uint64) bool {
mergedAtGenesis := config.TerminalTotalDifficulty != nil && config.TerminalTotalDifficulty.Sign() == 0
return mergedAtGenesis ||
config.MergeNetsplitBlock != nil && blockNum >= config.MergeNetsplitBlock.Uint64() ||
config.ShanghaiTime != nil && timestamp >= *config.ShanghaiTime ||
// If OP-Stack then bedrock activation number determines when TTD (eth Merge) has been reached.
config.IsOptimismBedrock(new(big.Int).SetUint64(blockNum))
}

// Author implements consensus.Engine, returning the verified author of the block.
Expand Down Expand Up @@ -126,7 +125,7 @@ func (beacon *Beacon) VerifyHeader(chain consensus.ChainHeaderReader, header *ty
// Check >0 TDs with pre-merge, --0 TDs with post-merge rules
if header.Difficulty.Sign() > 0 ||
// OP-Stack: transitioned networks must use legacy consensus pre-Bedrock
(cfg.IsOptimism() && !cfg.IsBedrock(header.Number)) {
cfg.IsOptimismBedrock(header.Number) {
return beacon.ethone.VerifyHeader(chain, header)
}
return beacon.verifyHeader(chain, header, parent)
Expand Down Expand Up @@ -352,15 +351,7 @@ func (beacon *Beacon) verifyHeaders(chain consensus.ChainHeaderReader, headers [
// Prepare implements consensus.Engine, initializing the difficulty field of a
// header to conform to the beacon protocol. The changes are done inline.
func (beacon *Beacon) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error {
// The beacon engine requires access to total difficulties to be able to
// seal pre-merge and post-merge blocks. With the transition to removing
// old blocks, TDs become unaccessible, thus making TTD based pre-/post-
// merge decisions impossible.
//
// We do not need to seal non-merge blocks anymore live, but we do need
// to be able to generate test chains, thus we're reverting to a testing-
// settable field to direct that.
if beacon.ttdblock != nil && *beacon.ttdblock >= header.Number.Uint64() {
if !isPostMerge(chain.Config(), header.Number.Uint64(), header.Time) {
return beacon.ethone.Prepare(chain, header)
}
header.Difficulty = beaconDifficulty
Expand Down Expand Up @@ -491,10 +482,7 @@ func (beacon *Beacon) CalcDifficulty(chain consensus.ChainHeaderReader, time uin
// We do not need to seal non-merge blocks anymore live, but we do need
// to be able to generate test chains, thus we're reverting to a testing-
// settable field to direct that.
cfg := chain.Config()
if beacon.ttdblock != nil && *beacon.ttdblock > parent.Number.Uint64() ||
// OP-Stack: transitioned networks must use legacy consensus pre-Bedrock
(cfg.IsOptimism() && !cfg.IsBedrock(new(big.Int).Add(parent.Number, common.Big1))) {
if !isPostMerge(chain.Config(), parent.Number.Uint64()+1, time) {
return beacon.ethone.CalcDifficulty(chain, time, parent)
}
return beaconDifficulty
Expand Down
8 changes: 8 additions & 0 deletions consensus/misc/eip4844/eip4844.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {

var frac uint64
switch config.LatestFork(header.Time) {
case forks.Osaka:
frac = config.BlobScheduleConfig.Osaka.UpdateFraction
case forks.Prague:
frac = config.BlobScheduleConfig.Prague.UpdateFraction
case forks.Cancun:
Expand All @@ -113,6 +115,8 @@ func MaxBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
s = cfg.BlobScheduleConfig
)
switch {
case cfg.IsOsaka(london, time) && s.Osaka != nil:
return s.Osaka.Max
case cfg.IsPrague(london, time) && s.Prague != nil:
return s.Prague.Max
case cfg.IsCancun(london, time) && s.Cancun != nil:
Expand All @@ -135,6 +139,8 @@ func LatestMaxBlobsPerBlock(cfg *params.ChainConfig) int {
return 0
}
switch {
case s.Osaka != nil:
return s.Osaka.Max
case s.Prague != nil:
return s.Prague.Max
case s.Cancun != nil:
Expand All @@ -154,6 +160,8 @@ func targetBlobsPerBlock(cfg *params.ChainConfig, time uint64) int {
s = cfg.BlobScheduleConfig
)
switch {
case cfg.IsOsaka(london, time) && s.Osaka != nil:
return s.Osaka.Target
case cfg.IsPrague(london, time) && s.Prague != nil:
return s.Prague.Target
case cfg.IsCancun(london, time) && s.Cancun != nil:
Expand Down
Loading

0 comments on commit cca9ecc

Please sign in to comment.