Skip to content

Commit 0fe415d

Browse files
authored
Merge branch 'run-mode-struct' into wasm-rebuild-missing-targets
2 parents 4f3ec0d + 3f25ce0 commit 0fe415d

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

arbitrum/backend.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/ethereum/go-ethereum/ethdb"
1616
"github.com/ethereum/go-ethereum/event"
1717
"github.com/ethereum/go-ethereum/internal/shutdowncheck"
18+
"github.com/ethereum/go-ethereum/log"
1819
"github.com/ethereum/go-ethereum/node"
1920
"github.com/ethereum/go-ethereum/rpc"
2021
)
@@ -128,7 +129,16 @@ func (b *Backend) updateFilterMapsHeads() {
128129
headEventCh := make(chan core.ChainEvent, 10)
129130
blockProcCh := make(chan bool, 10)
130131
sub := b.arb.BlockChain().SubscribeChainEvent(headEventCh)
132+
if sub == nil {
133+
log.Error("arbitrum Backend: failed subscribing to Head Event")
134+
return
135+
}
131136
sub2 := b.arb.BlockChain().SubscribeBlockProcessingEvent(blockProcCh)
137+
if sub2 == nil {
138+
log.Error("arbitrum Backend: failed subscribing to Block Processing Event")
139+
sub.Unsubscribe()
140+
return
141+
}
132142
defer func() {
133143
sub.Unsubscribe()
134144
sub2.Unsubscribe()

arbitrum/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"time"
77

8+
"github.com/ethereum/go-ethereum/core/rawdb"
89
"github.com/ethereum/go-ethereum/eth/ethconfig"
910
flag "github.com/spf13/pflag"
1011
)
@@ -119,4 +120,5 @@ var DefaultConfig = Config{
119120
TimeoutQueueBound: 512,
120121
},
121122
BlockRedirectsList: "default",
123+
StateScheme: rawdb.HashScheme,
122124
}

consensus/misc/eip4844/eip4844.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
8181

8282
// CalcBlobFee calculates the blobfee from the header's excess blob gas field.
8383
func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
84+
if config.IsArbitrum() {
85+
// Arbitrum does not support blob transactions, so we return 0.
86+
return big.NewInt(0)
87+
}
8488
var frac uint64
8589
switch config.LatestFork(header.Time, types.DeserializeHeaderExtraInformation(header).ArbOSFormatVersion) {
8690
case forks.Osaka:

core/rawdb/accessors_trie.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,20 @@ func ReadStateScheme(db ethdb.Database) string {
265265
if id := ReadPersistentStateID(vdb); id != 0 {
266266
return PathScheme
267267
}
268+
genesisBlockNumber := uint64(0)
269+
block0Hash := ReadCanonicalHash(db, 0)
270+
if (block0Hash != common.Hash{}) {
271+
chainConfig := ReadChainConfig(db, block0Hash)
272+
if chainConfig != nil {
273+
if chainConfig.IsArbitrum() {
274+
genesisBlockNumber = chainConfig.ArbitrumChainParams.GenesisBlockNum
275+
}
276+
}
277+
}
268278
// In a hash-based scheme, the genesis state is consistently stored
269279
// on the disk. To assess the scheme of the persistent state, it
270280
// suffices to inspect the scheme of the genesis state.
271-
header := ReadHeader(db, ReadCanonicalHash(db, 0), 0)
281+
header := ReadHeader(db, ReadCanonicalHash(db, genesisBlockNumber), genesisBlockNumber)
272282
if header == nil {
273283
return "" // empty datadir
274284
}

0 commit comments

Comments
 (0)