mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 03:51:20 +00:00
72ba18bd36
Added operation pools for beacon chain. operations are the equivalent of txs for eth2 Added operation pools for: * Attester Slashings * Proposer Slashings * VoluntaryExits * BLSExecutionToChange * Postponed to later: Attestations (or maybe not)
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
package forkchoice
|
|
|
|
import (
|
|
"github.com/ledgerwatch/erigon-lib/common"
|
|
"github.com/ledgerwatch/erigon/cl/cltypes"
|
|
"github.com/ledgerwatch/erigon/cl/cltypes/solid"
|
|
"github.com/ledgerwatch/erigon/cl/phase1/execution_client"
|
|
)
|
|
|
|
type ForkChoiceStorage interface {
|
|
ForkChoiceStorageWriter
|
|
ForkChoiceStorageReader
|
|
}
|
|
|
|
type ForkChoiceStorageReader interface {
|
|
Ancestor(root common.Hash, slot uint64) common.Hash
|
|
AnchorSlot() uint64
|
|
Engine() execution_client.ExecutionEngine
|
|
FinalizedCheckpoint() solid.Checkpoint
|
|
FinalizedSlot() uint64
|
|
GetEth1Hash(eth2Root common.Hash) common.Hash
|
|
GetHead() (common.Hash, uint64, error)
|
|
HighestSeen() uint64
|
|
JustifiedCheckpoint() solid.Checkpoint
|
|
ProposerBoostRoot() common.Hash
|
|
Slot() uint64
|
|
Time() uint64
|
|
}
|
|
|
|
type ForkChoiceStorageWriter interface {
|
|
OnAttestation(attestation *solid.Attestation, fromBlock bool) error
|
|
OnAttesterSlashing(attesterSlashing *cltypes.AttesterSlashing, test bool) error
|
|
OnBlock(block *cltypes.SignedBeaconBlock, newPayload bool, fullValidation bool) error
|
|
OnTick(time uint64)
|
|
}
|