Skip to content

Commit

Permalink
consensus: add fast finality interface (axieinfinity#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
minh-bq committed Aug 29, 2023
1 parent 7bfc614 commit 67c7d73
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
package consensus

import (
"math/big"

"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/ethdb"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
Expand Down Expand Up @@ -147,3 +148,21 @@ type PoSA interface {
IsSystemTransaction(tx *types.Transaction, header *types.Header) (bool, error)
IsSystemContract(to *common.Address) bool
}

type FastFinalityPoSA interface {
PoSA

GetJustifiedBlock(chain ChainHeaderReader, blockNumber uint64, blockHash common.Hash) (uint64, common.Hash)
GetFinalizedBlock(chain ChainHeaderReader, blockNumber uint64, blockHash common.Hash) (uint64, common.Hash)

// IsActiveValidatorAt always returns false before Shillin
IsActiveValidatorAt(chain ChainHeaderReader, header *types.Header) bool

// VerifyVote check if the finality voter is in the validator set, it assumes the signature is
// already verified
VerifyVote(chain ChainHeaderReader, vote *types.VoteEnvelope) error
}

type VotePool interface {
FetchVoteByBlockHash(blockHash common.Hash) []*types.VoteEnvelope
}

0 comments on commit 67c7d73

Please sign in to comment.