mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
fix(api-backend): disable finalized tag when rollup verify is disabled (#722)
This commit is contained in:
parent
005db0370e
commit
a860446eba
2 changed files with 7 additions and 1 deletions
|
|
@ -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")
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue