-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
L2 head move #2
L2 head move #2
Conversation
} else { | ||
// taking last block from L2 instead of parent based on L1 block id | ||
// parent, err = s.rpc.L2ParentByBlockID(ctx, event.BlockId) | ||
parent, err = s.rpc.L2.HeaderByNumber(ctx, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking last L2 block instead
return fmt.Errorf("failed to insert new head to L2 execution engine: %w", err) | ||
} | ||
|
||
metrics.DriverL1CurrentHeightGauge.Set(float64(lastInsertedBlockHeader.Number.Uint64())) //(float64(event.Raw.BlockNumber)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting height here as a block number
) | ||
|
||
// Get withdrawals | ||
withdrawals := types.Withdrawals{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty withdrawals
) | ||
var attributes *engine.PayloadAttributes | ||
if event == nil { | ||
attributes = &engine.PayloadAttributes{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default values here when event is nil, so in our case
// Get L2 baseFee | ||
baseFeeInfo, err := s.rpc.TaikoL2.GetBasefee( | ||
&bind.CallOpts{BlockNumber: parent.Number, Context: ctx}, | ||
l1Origin.BlockID.Uint64(), // event.Meta.L1Height, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using block id instead of L1 height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would just get l1 height from l1 execution client instead.
"gasUsed", parentGasUsed, | ||
) | ||
|
||
return c.rpc.TaikoL2.Anchor(opts, common.BigToHash(common.Big0), common.BigToHash(common.Big0), common.Big0.Uint64(), uint32(parentGasUsed)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting basefee here can be taken from L1 at the current time instead of setting itto 0. 0 baseFee and 0 gas used could lead to problems. these can be simulated using eth_call
and eth_estimateGas
on l1 execution client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a 0, it's taken from the parent, which is the latest L2 block: https://github.com/NethermindEth/taiko-mono/pull/2/files#diff-6d16849826f000a80f50a99715c4b4c162bbe2f7f75cc43f4e4ba6a15e60f708R434
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes no sense, though, because gasUsee in this block will definitely be different and can easily be extracted.
Let's do GasUsed
: get it from the l1 call with eth_estimateGas
And BaseFee
: Get it from parent block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I call eth_estimateGas
I need to specify ethereum.CallMsg
. I'm not sure for which L1 message you want to estimate gas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the tx that 2ill be sent to mev boost for force inclusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But here we have no L1 tx, just L2 block 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send the gasUseed value with the payload from the avs node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so I understand to have another parameter for the used gas in the MoveTheHead
method, and I'll pass there the value of used gas in Rust AVS node part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sir
// Get L2 baseFee | ||
baseFeeInfo, err := s.rpc.TaikoL2.GetBasefee( | ||
&bind.CallOpts{BlockNumber: parent.Number, Context: ctx}, | ||
l1Origin.BlockID.Uint64(), // event.Meta.L1Height, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would just get l1 height from l1 execution client instead.
Skipped tests which require prover to be run, and other failing, e.g. related to reorg. |
* Rpc server for fetching L2 tx lists * RPC server with python test file * RPC for sending L2 blocks * Returning L2 tx lists in JSON RPC * dependencies * L2 head move (#2) * RPC server with python test file * RPC for sending L2 blocks * Returning L2 tx lists in JSON RPC * dependencies * insert new head using decoded tx lists * replacement for blockProposed event to move the head manually * RPC server for the driver - init * Advancing the L2 head without blockProposed event * Tests for MoveTheHead * Signed transactions for moveTheHead test * lint * review corrections * used gas passed as parameter for MoveTheHead * commented some proposer tests, as proposer eventloop is not running * tests skipping * more skips * Custom response for the proposer RPC, not to return incompatible `"error":null` * Same custom response for the driver RPC * tests limited to syncer * Returning encoded, compressed txLists and parent meta hash for RPC.GetL2TxLists * Returning encoded, compressed txLists along with JSON * lint * parent meta hash for the GetL2TxLists * commented precommit hook * print base url in get blobs * error at the beginning * potential fix for forking * info logs for block proposed event * fix forkchoice wrong hash * minor fix for parent block * final fix hopefully for forkchoice finalized * removed unneeded check * brought back taking last L1 block in MoveTheHead * L2 block ID set as its parent+1 * Replaced AssembleNullAnchorTx with AssembleAnchorTx for advancing the head * lint --------- Co-authored-by: Ahmad Bitar <[email protected]>
* Rpc server for fetching L2 tx lists * RPC server with python test file * RPC for sending L2 blocks * Returning L2 tx lists in JSON RPC * dependencies * L2 head move (#2) * RPC server with python test file * RPC for sending L2 blocks * Returning L2 tx lists in JSON RPC * dependencies * insert new head using decoded tx lists * replacement for blockProposed event to move the head manually * RPC server for the driver - init * Advancing the L2 head without blockProposed event * Tests for MoveTheHead * Signed transactions for moveTheHead test * lint * review corrections * used gas passed as parameter for MoveTheHead * commented some proposer tests, as proposer eventloop is not running * tests skipping * more skips * Custom response for the proposer RPC, not to return incompatible `"error":null` * Same custom response for the driver RPC * tests limited to syncer * Returning encoded, compressed txLists and parent meta hash for RPC.GetL2TxLists * Returning encoded, compressed txLists along with JSON * lint * parent meta hash for the GetL2TxLists * commented precommit hook * print base url in get blobs * error at the beginning * potential fix for forking * info logs for block proposed event * fix forkchoice wrong hash * minor fix for parent block * final fix hopefully for forkchoice finalized * removed unneeded check * brought back taking last L1 block in MoveTheHead * L2 block ID set as its parent+1 * Replaced AssembleNullAnchorTx with AssembleAnchorTx for advancing the head * lint --------- Co-authored-by: Ahmad Bitar <[email protected]>
* Rpc server for fetching L2 tx lists * RPC server with python test file * RPC for sending L2 blocks * Returning L2 tx lists in JSON RPC * dependencies * L2 head move (#2) * RPC server with python test file * RPC for sending L2 blocks * Returning L2 tx lists in JSON RPC * dependencies * insert new head using decoded tx lists * replacement for blockProposed event to move the head manually * RPC server for the driver - init * Advancing the L2 head without blockProposed event * Tests for MoveTheHead * Signed transactions for moveTheHead test * lint * review corrections * used gas passed as parameter for MoveTheHead * commented some proposer tests, as proposer eventloop is not running * tests skipping * more skips * Custom response for the proposer RPC, not to return incompatible `"error":null` * Same custom response for the driver RPC * tests limited to syncer * Returning encoded, compressed txLists and parent meta hash for RPC.GetL2TxLists * Returning encoded, compressed txLists along with JSON * lint * parent meta hash for the GetL2TxLists * commented precommit hook * print base url in get blobs * error at the beginning * potential fix for forking * info logs for block proposed event * fix forkchoice wrong hash * minor fix for parent block * final fix hopefully for forkchoice finalized * removed unneeded check * brought back taking last L1 block in MoveTheHead * L2 block ID set as its parent+1 * Replaced AssembleNullAnchorTx with AssembleAnchorTx for advancing the head * lint --------- Co-authored-by: Ahmad Bitar <[email protected]>
No description provided.