Skip to content

Commit 16bf1f4

Browse files
committed
Merge branch 'master' into up-dev-arbos40
2 parents 6c05c2c + ee3eefa commit 16bf1f4

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

arbitrum/apibackend.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ func CreateFallbackClient(fallbackClientUrl string, fallbackClientTimeout time.D
120120
}
121121

122122
type SyncProgressBackend interface {
123-
SyncProgressMap(ctx context.Context) map[string]interface{}
124-
BlockMetadataByNumber(ctx context.Context, blockNum uint64) (common.BlockMetadata, error)
123+
SyncProgressMap() map[string]interface{}
124+
BlockMetadataByNumber(blockNum uint64) (common.BlockMetadata, error)
125125
}
126126

127127
func createRegisterAPIBackend(backend *Backend, filterConfig filters.Config, fallbackClientUrl string, fallbackClientTimeout time.Duration) (*filters.FilterSystem, error) {
@@ -205,17 +205,17 @@ func (a *APIBackend) GetBody(ctx context.Context, hash common.Hash, number rpc.B
205205
}
206206

207207
// General Ethereum API
208-
func (a *APIBackend) SyncProgressMap(ctx context.Context) map[string]interface{} {
208+
func (a *APIBackend) SyncProgressMap() map[string]interface{} {
209209
if a.sync == nil {
210210
res := make(map[string]interface{})
211211
res["error"] = "sync object not set in apibackend"
212212
return res
213213
}
214-
return a.sync.SyncProgressMap(ctx)
214+
return a.sync.SyncProgressMap()
215215
}
216216

217217
func (a *APIBackend) SyncProgress() ethereum.SyncProgress {
218-
progress := a.SyncProgressMap(context.Background())
218+
progress := a.SyncProgressMap()
219219

220220
if len(progress) == 0 {
221221
return ethereum.SyncProgress{}
@@ -496,8 +496,8 @@ func (a *APIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.
496496
return nil, errors.New("invalid arguments; neither block nor hash specified")
497497
}
498498

499-
func (a *APIBackend) BlockMetadataByNumber(ctx context.Context, blockNum uint64) (common.BlockMetadata, error) {
500-
return a.sync.BlockMetadataByNumber(ctx, blockNum)
499+
func (a *APIBackend) BlockMetadataByNumber(blockNum uint64) (common.BlockMetadata, error) {
500+
return a.sync.BlockMetadataByNumber(blockNum)
501501
}
502502

503503
func StateAndHeaderFromHeader(ctx context.Context, chainDb ethdb.Database, bc *core.BlockChain, maxRecreateStateDepth int64, header *types.Header, err error) (*state.StateDB, *types.Header, error) {

eth/api_backend.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (b *EthAPIBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash r
182182
return nil, errors.New("invalid arguments; neither block nor hash specified")
183183
}
184184

185-
func (b *EthAPIBackend) BlockMetadataByNumber(ctx context.Context, blockNum uint64) (common.BlockMetadata, error) {
185+
func (b *EthAPIBackend) BlockMetadataByNumber(blockNum uint64) (common.BlockMetadata, error) {
186186
return nil, nil
187187
}
188188

@@ -354,7 +354,7 @@ func (b *EthAPIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.S
354354
return b.eth.txPool.SubscribeTransactions(ch, true)
355355
}
356356

357-
func (b *EthAPIBackend) SyncProgressMap(ctx context.Context) map[string]interface{} {
357+
func (b *EthAPIBackend) SyncProgressMap() map[string]interface{} {
358358
progress := b.eth.Downloader().Progress()
359359
return progress.ToMap()
360360
}

internal/ethapi/api.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ func (api *EthereumAPI) BlobBaseFee(ctx context.Context) *hexutil.Big {
152152
// - highestBlock: block number of the highest block header this node has received from peers
153153
// - pulledStates: number of state entries processed until now
154154
// - knownStates: number of known state entries that still need to be pulled
155-
func (api *EthereumAPI) Syncing(ctx context.Context) (interface{}, error) {
156-
progress := api.b.SyncProgressMap(ctx)
155+
func (api *EthereumAPI) Syncing() (interface{}, error) {
156+
progress := api.b.SyncProgressMap()
157157

158158
if len(progress) == 0 {
159159
return false, nil
@@ -1653,7 +1653,7 @@ func marshalReceipt(ctx context.Context, receipt *types.Receipt, blockHash commo
16531653

16541654
// If blockMetadata exists for the block containing this tx, then we will determine if it was timeboosted or not
16551655
// and add that info to the receipt object
1656-
blockMetadata, err := backend.BlockMetadataByNumber(ctx, blockNumber)
1656+
blockMetadata, err := backend.BlockMetadataByNumber(blockNumber)
16571657
if err != nil {
16581658
return nil, err
16591659
}

internal/ethapi/api_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ func (b testBackend) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.
535535
}
536536
panic("unknown type rpc.BlockNumberOrHash")
537537
}
538-
func (b testBackend) BlockMetadataByNumber(ctx context.Context, blockNum uint64) (common.BlockMetadata, error) {
538+
func (b testBackend) BlockMetadataByNumber(blockNum uint64) (common.BlockMetadata, error) {
539539
return nil, nil
540540
}
541541
func (b testBackend) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error) {
@@ -628,7 +628,7 @@ func (b testBackend) FallbackClient() types.FallbackClient {
628628
return nil
629629
}
630630

631-
func (b testBackend) SyncProgressMap(ctx context.Context) map[string]interface{} {
631+
func (b testBackend) SyncProgressMap() map[string]interface{} {
632632
return map[string]interface{}{}
633633
}
634634

internal/ethapi/backend.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type Backend interface {
4444

4545
// General Ethereum API
4646
SyncProgress() ethereum.SyncProgress
47-
SyncProgressMap(ctx context.Context) map[string]interface{}
47+
SyncProgressMap() map[string]interface{}
4848

4949
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
5050
FeeHistory(ctx context.Context, blockCount uint64, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*big.Int, [][]*big.Int, []*big.Int, []float64, []*big.Int, []float64, error)
@@ -67,7 +67,7 @@ type Backend interface {
6767
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
6868
BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)
6969
BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error)
70-
BlockMetadataByNumber(ctx context.Context, blockNum uint64) (common.BlockMetadata, error) // This queries SyncProgressBackend (execution's syncMonitor) to fetch blockMetadata for a given block number
70+
BlockMetadataByNumber(blockNum uint64) (common.BlockMetadata, error) // This queries SyncProgressBackend (execution's syncMonitor) to fetch blockMetadata for a given block number
7171
StateAndHeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*state.StateDB, *types.Header, error)
7272
StateAndHeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*state.StateDB, *types.Header, error)
7373
Pending() (*types.Block, types.Receipts, *state.StateDB)

internal/ethapi/transaction_args_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func (b *backendMock) BlockByHash(ctx context.Context, hash common.Hash) (*types
354354
func (b *backendMock) BlockByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Block, error) {
355355
return nil, nil
356356
}
357-
func (b *backendMock) BlockMetadataByNumber(ctx context.Context, blockNum uint64) (common.BlockMetadata, error) {
357+
func (b *backendMock) BlockMetadataByNumber(blockNum uint64) (common.BlockMetadata, error) {
358358
return nil, nil
359359
}
360360
func (b *backendMock) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error) {
@@ -410,6 +410,6 @@ func (b *backendMock) FallbackClient() types.FallbackClient {
410410
return nil
411411
}
412412

413-
func (b *backendMock) SyncProgressMap(ctx context.Context) map[string]interface{} {
413+
func (b *backendMock) SyncProgressMap() map[string]interface{} {
414414
return nil
415415
}

0 commit comments

Comments
 (0)