Skip to content

Commit

Permalink
fix(api-backend): disable finalized tag when rollup verify is disabled (
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Apr 26, 2024
1 parent 005db03 commit a860446
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions eth/api_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ func (b *EthAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumb
return b.eth.blockchain.CurrentBlock().Header(), nil
}
if number == rpc.FinalizedBlockNumber {
if !b.eth.config.EnableRollupVerify {
return nil, errors.New("sync L1 finalized batch feature not enabled, cannot query L2 finalized block height")
}
finalizedBlockHeightPtr := rawdb.ReadFinalizedL2BlockNumber(b.eth.ChainDb())
if finalizedBlockHeightPtr == nil {
return nil, errors.New("L2 finalized block height not found in database")
Expand Down Expand Up @@ -119,6 +122,9 @@ func (b *EthAPIBackend) BlockByNumber(ctx context.Context, number rpc.BlockNumbe
return b.eth.blockchain.CurrentBlock(), nil
}
if number == rpc.FinalizedBlockNumber {
if !b.eth.config.EnableRollupVerify {
return nil, errors.New("sync L1 finalized batch feature not enabled, cannot query L2 finalized block height")
}
finalizedBlockHeightPtr := rawdb.ReadFinalizedL2BlockNumber(b.eth.ChainDb())
if finalizedBlockHeightPtr == nil {
return nil, errors.New("L2 finalized block height not found in database")
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionPatch = 6 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)

Expand Down

0 comments on commit a860446

Please sign in to comment.