txsubmitter

package
v0.0.0-...-dbe7483 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FallbackGasTipCap       = big.NewInt(15000000000)
	ErrCannotGetECDSAPubKey = errors.New("ErrCannotGetECDSAPubKey")
	ErrTransactionFailed    = errors.New("ErrTransactionFailed")
)

Functions

func ConvertProofsToBytes32Array

func ConvertProofsToBytes32Array(proof []eigenpodproofs.Bytes32) [][32]byte

Types

type ChainClient

type ChainClient struct {
	*ethclient.Client

	AccountAddress     common.Address
	NoSendTransactOpts *bind.TransactOpts
	Contracts          map[common.Address]*bind.BoundContract
	// contains filtered or unexported fields
}

func NewChainClient

func NewChainClient(ethClient *ethclient.Client, privateKeyString string, address string, gasPrice int64, gasLimit uint64) (*ChainClient, error)

func (*ChainClient) EnsureTransactionEvaled

func (c *ChainClient) EnsureTransactionEvaled(tx *types.Transaction, tag string) (*types.Receipt, error)

func (*ChainClient) EstimateGasPriceAndLimitAndSendTx

func (c *ChainClient) EstimateGasPriceAndLimitAndSendTx(
	ctx context.Context,
	tx *types.Transaction,
	tag string,
) (*types.Receipt, error)

EstimateGasPriceAndLimitAndSendTx sends and returns an otherwise identical txn to the one provided but with updated gas prices sampled from the existing network conditions and an accurate gasLimit

Note: tx must be a to a contract, not an EOA

Slightly modified from: https://github.com/ethereum-optimism/optimism/blob/ec266098641820c50c39c31048aa4e953bece464/batch-submitter/drivers/sequencer/driver.go#L314

func (*ChainClient) GetAccountAddress

func (c *ChainClient) GetAccountAddress() common.Address

func (*ChainClient) GetCurrentBlockNumber

func (c *ChainClient) GetCurrentBlockNumber(ctx context.Context) (uint32, error)

func (*ChainClient) GetNoSendTransactOpts

func (c *ChainClient) GetNoSendTransactOpts() *bind.TransactOpts

type EigenPodProofTxSubmitter

type EigenPodProofTxSubmitter struct {
	// contains filtered or unexported fields
}

func NewEigenPodProofTxSubmitter

func NewEigenPodProofTxSubmitter(chainClient ChainClient, epp eigenpodproofs.EigenPodProofs) *EigenPodProofTxSubmitter

func (*EigenPodProofTxSubmitter) GenerateVerifyAndProcessWithdrawalsTx

func (u *EigenPodProofTxSubmitter) GenerateVerifyAndProcessWithdrawalsTx(
	eigenpod common.Address,
	versionedOracleState *spec.VersionedBeaconState,
	oracleBeaconBlockHeader *phase0.BeaconBlockHeader,
	historicalSummaryStateBlockRoots [][]phase0.Root,
	withdrawalBlocks []*spec.VersionedSignedBeaconBlock,
	validatorIndices []uint64,
) (*types.Transaction, error)

func (*EigenPodProofTxSubmitter) GenerateVerifyWithdrawalCredentialsTx

func (u *EigenPodProofTxSubmitter) GenerateVerifyWithdrawalCredentialsTx(
	eigenpod common.Address,
	versionedOracleState *spec.VersionedBeaconState,
	oracleBeaconBlockHeader *phase0.BeaconBlockHeader,
	validatorIndices []uint64,
) (*types.Transaction, error)

func (*EigenPodProofTxSubmitter) SubmitVerifyAndProcessWithdrawalsTx

func (u *EigenPodProofTxSubmitter) SubmitVerifyAndProcessWithdrawalsTx(withdrawalProofConfig string, submitTransaction bool) ([]byte, error)

func (*EigenPodProofTxSubmitter) SubmitVerifyWithdrawalCredentialsTx

func (u *EigenPodProofTxSubmitter) SubmitVerifyWithdrawalCredentialsTx(withdrawalCredentialsProofConfig string, submitTransaction bool) ([]byte, error)

type WithdrawalCredentialProofConfig

type WithdrawalCredentialProofConfig struct {
	EigenPodAddress  common.Address `json:"EIGENPOD_ADDRESS,required"`
	ValidatorIndices []uint64       `json:"VALIDATOR_INDICES,required"`

	BeaconStateFiles struct {
		OracleStateFile       string `json:"ORACLE_STATE_FILE,required"`
		OracleBlockHeaderFile string `json:"ORACLE_BLOCK_HEADER_FILE,required"`
	}
}

type WithdrawalProofConfig

type WithdrawalProofConfig struct {
	EigenPodAddress common.Address `json:"EIGENPOD_ADDRESS,required"`

	BeaconStateFiles struct {
		OracleStateFile       string `json:"ORACLE_STATE_FILE,required"`
		OracleBlockHeaderFile string `json:"ORACLE_BLOCK_HEADER_FILE,required"`
	}

	WithdrawalDetails struct {
		ValidatorIndices            []uint64 `json:"VALIDATOR_INDICES,required"`
		WithdrawalBlockHeaderFiles  []string `json:"WITHDRAWAL_BLOCK_HEADER_FILES,required"`
		WithdrawalBlockBodyFiles    []string `json:"WITHDRAWAL_BLOCK_BODY_FILES,required"`
		HistoricalSummaryStateFiles []string `json:"HISTORICAL_SUMMARY_STATE_FILES,required"`
	}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL