2023-06-11 21:50:02 +00:00
|
|
|
package funcmap
|
|
|
|
|
|
|
|
import (
|
2023-07-19 22:20:33 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cl/abstract"
|
2023-06-11 21:50:02 +00:00
|
|
|
"github.com/ledgerwatch/erigon/cl/cltypes"
|
|
|
|
"github.com/ledgerwatch/erigon/cl/cltypes/solid"
|
|
|
|
"github.com/ledgerwatch/erigon/cl/transition/machine"
|
|
|
|
"github.com/ledgerwatch/erigon/core/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ machine.Interface = (*Impl)(nil)
|
|
|
|
|
|
|
|
type Impl struct {
|
2023-07-19 22:20:33 +00:00
|
|
|
FnVerifyBlockSignature func(s abstract.BeaconState, block *cltypes.SignedBeaconBlock) error
|
|
|
|
FnVerifyTransition func(s abstract.BeaconState, block *cltypes.BeaconBlock) error
|
|
|
|
FnProcessSlots func(s abstract.BeaconState, slot uint64) error
|
|
|
|
FnProcessBlockHeader func(s abstract.BeaconState, block *cltypes.BeaconBlock) error
|
|
|
|
FnProcessWithdrawals func(s abstract.BeaconState, withdrawals *solid.ListSSZ[*types.Withdrawal]) error
|
|
|
|
FnProcessExecutionPayload func(s abstract.BeaconState, payload *cltypes.Eth1Block) error
|
|
|
|
FnProcessRandao func(s abstract.BeaconState, randao [96]byte, proposerIndex uint64) error
|
|
|
|
FnProcessEth1Data func(state abstract.BeaconState, eth1Data *cltypes.Eth1Data) error
|
|
|
|
FnProcessSyncAggregate func(s abstract.BeaconState, sync *cltypes.SyncAggregate) error
|
2023-06-11 21:50:02 +00:00
|
|
|
FnVerifyKzgCommitmentsAgainstTransactions func(transactions *solid.TransactionsSSZ, kzgCommitments *solid.ListSSZ[*cltypes.KZGCommitment]) (bool, error)
|
2023-07-19 22:20:33 +00:00
|
|
|
FnProcessProposerSlashing func(s abstract.BeaconState, propSlashing *cltypes.ProposerSlashing) error
|
|
|
|
FnProcessAttesterSlashing func(s abstract.BeaconState, attSlashing *cltypes.AttesterSlashing) error
|
|
|
|
FnProcessAttestations func(s abstract.BeaconState, attestations *solid.ListSSZ[*solid.Attestation]) error
|
|
|
|
FnProcessDeposit func(s abstract.BeaconState, deposit *cltypes.Deposit) error
|
|
|
|
FnProcessVoluntaryExit func(s abstract.BeaconState, signedVoluntaryExit *cltypes.SignedVoluntaryExit) error
|
|
|
|
FnProcessBlsToExecutionChange func(state abstract.BeaconState, signedChange *cltypes.SignedBLSToExecutionChange) error
|
2023-06-11 21:50:02 +00:00
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) VerifyBlockSignature(s abstract.BeaconState, block *cltypes.SignedBeaconBlock) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnVerifyBlockSignature(s, block)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) VerifyTransition(s abstract.BeaconState, block *cltypes.BeaconBlock) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnVerifyTransition(s, block)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessBlockHeader(s abstract.BeaconState, block *cltypes.BeaconBlock) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessBlockHeader(s, block)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessWithdrawals(s abstract.BeaconState, withdrawals *solid.ListSSZ[*types.Withdrawal]) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessWithdrawals(s, withdrawals)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessExecutionPayload(s abstract.BeaconState, payload *cltypes.Eth1Block) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessExecutionPayload(s, payload)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessRandao(s abstract.BeaconState, randao [96]byte, proposerIndex uint64) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessRandao(s, randao, proposerIndex)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessEth1Data(state abstract.BeaconState, eth1Data *cltypes.Eth1Data) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessEth1Data(state, eth1Data)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessSyncAggregate(s abstract.BeaconState, sync *cltypes.SyncAggregate) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessSyncAggregate(s, sync)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (i Impl) VerifyKzgCommitmentsAgainstTransactions(transactions *solid.TransactionsSSZ, kzgCommitments *solid.ListSSZ[*cltypes.KZGCommitment]) (bool, error) {
|
|
|
|
return i.FnVerifyKzgCommitmentsAgainstTransactions(transactions, kzgCommitments)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessProposerSlashing(s abstract.BeaconState, propSlashing *cltypes.ProposerSlashing) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessProposerSlashing(s, propSlashing)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessAttesterSlashing(s abstract.BeaconState, attSlashing *cltypes.AttesterSlashing) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessAttesterSlashing(s, attSlashing)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessAttestations(s abstract.BeaconState, attestations *solid.ListSSZ[*solid.Attestation]) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessAttestations(s, attestations)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessDeposit(s abstract.BeaconState, deposit *cltypes.Deposit) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessDeposit(s, deposit)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessVoluntaryExit(s abstract.BeaconState, signedVoluntaryExit *cltypes.SignedVoluntaryExit) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessVoluntaryExit(s, signedVoluntaryExit)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessBlsToExecutionChange(state abstract.BeaconState, signedChange *cltypes.SignedBLSToExecutionChange) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessBlsToExecutionChange(state, signedChange)
|
|
|
|
}
|
|
|
|
|
2023-07-19 22:20:33 +00:00
|
|
|
func (i Impl) ProcessSlots(s abstract.BeaconState, slot uint64) error {
|
2023-06-11 21:50:02 +00:00
|
|
|
return i.FnProcessSlots(s, slot)
|
|
|
|
}
|