Documentation ¶
Index ¶
- func NewWithdrawalTx(nonce int64, sender, target common.Address, value, gasLimit *big.Int) *crossdomain.Withdrawal
- func ProveWithdrawalParameters(stack *StackConfig, withdrawalTx crossdomain.Withdrawal, ...) (withdrawals.ProvenWithdrawalParameters, error)
- func Run(ctx context.Context, env *environment.Env, outDir string) error
- type L1Client
- type MonomerClient
- func (m *MonomerClient) BlockByNumber(ctx context.Context, number *big.Int) (*ethtypes.Block, error)
- func (m *MonomerClient) ChainID(ctx context.Context) (*big.Int, error)
- func (m *MonomerClient) GenesisHash(ctx context.Context) (common.Hash, error)
- func (m *MonomerClient) GetProof(ctx context.Context, account common.Address, keys []string, ...) (*gethclient.AccountResult, error)
- type StackConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithdrawalTx ¶
func NewWithdrawalTx(nonce int64, sender, target common.Address, value, gasLimit *big.Int) *crossdomain.Withdrawal
func ProveWithdrawalParameters ¶
func ProveWithdrawalParameters( stack *StackConfig, withdrawalTx crossdomain.Withdrawal, l2BlockNumber *big.Int, ) (withdrawals.ProvenWithdrawalParameters, error)
ProveWithdrawalParameters queries L1 & L2 to generate all withdrawal parameters and proof necessary to prove a withdrawal on L1. The l2BlockNumber provided is very important. It should be a block that is greater than or equal to the block where the withdrawal was initiated on L2 and needs to have a submitted output in the L2 Output Oracle contract. If not, the withdrawal will fail since the storage proof cannot be verified if there is no submitted state root.
For example, if a withdrawal was initiated on L2 block 7 and the proposer submits an L2 output to L1 every 5 L2 blocks, then the L2 block number to prove against for the withdrawal would need to be in the following subset: (10, 15, 20, 25, ...)
ProveWithdrawalParameters is heavily inspired by ProveWithdrawalParametersForBlock in the optimism repo. https://github.com/ethereum-optimism/optimism/blob/5b13bad/op-node/withdrawals/utils.go#L75
Types ¶
type L1Client ¶
func NewL1Client ¶
type MonomerClient ¶
type MonomerClient struct {
// contains filtered or unexported fields
}
func NewMonomerClient ¶
func NewMonomerClient(client *rpc.Client) *MonomerClient
func (*MonomerClient) BlockByNumber ¶
func (*MonomerClient) GenesisHash ¶
func (*MonomerClient) GetProof ¶
func (m *MonomerClient) GetProof( ctx context.Context, account common.Address, keys []string, blockNumber *big.Int, ) (*gethclient.AccountResult, error)
GetProof returns the account and storage values of the specified account including the Merkle-proof. The block number can be nil, in which case the value is taken from the latest known block.
type StackConfig ¶
type StackConfig struct { Ctx context.Context Users []*ecdsa.PrivateKey L1Client *L1Client L1Deployments *opgenesis.L1Deployments OptimismPortal *bindings.OptimismPortal L1StandardBridge *opbindings.L1StandardBridge L2OutputOracleCaller *bindings.L2OutputOracleCaller L2Client *bftclient.HTTP MonomerClient *MonomerClient RollupConfig *rollup.Config WaitL1 func(numBlocks int) error WaitL2 func(numBlocks int) error }