Skip to content

Commit

Permalink
Advancing the L2 head without blockProposed event
Browse files Browse the repository at this point in the history
  • Loading branch information
mskrzypkows committed Jun 12, 2024
1 parent 0556725 commit 3a1f631
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,28 @@ func (c *AnchorTxConstructor) AssembleAnchorTx(
return c.rpc.TaikoL2.Anchor(opts, l1Hash, l1Header.Root, l1Height.Uint64(), uint32(parentGasUsed))
}

func (c *AnchorTxConstructor) AssembleNullAnchorTx(
ctx context.Context,
// Height of the L2 block which including the TaikoL2.anchor transaction.
l2Height *big.Int,
baseFee *big.Int,
parentGasUsed uint64,
) (*types.Transaction, error) {
opts, err := c.transactOpts(ctx, l2Height, baseFee)
if err != nil {
return nil, err
}

log.Info(
"Null anchor arguments",
"l2Height", l2Height,
"baseFee", utils.WeiToGWei(baseFee),
"gasUsed", parentGasUsed,
)

return c.rpc.TaikoL2.Anchor(opts, common.BigToHash(common.Big0), common.BigToHash(common.Big0), common.Big0.Uint64(), uint32(parentGasUsed))
}

// transactOpts is a utility method to create some transact options of the anchor transaction in given L2 block with
// golden touch account's private key.
func (c *AnchorTxConstructor) transactOpts(
Expand Down
Loading

0 comments on commit 3a1f631

Please sign in to comment.