-
Notifications
You must be signed in to change notification settings - Fork 106
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
New witness calculation and DA config #436
base: reth-1.2.0
Are you sure you want to change the base?
New witness calculation and DA config #436
Conversation
Add DA config to builder Account for builder_tx in block_da_size.
// Check that it's possible to create builder tx, considering max_da_tx_size, otherwise panic | ||
if let Some(tx_da_limit) = ctx.da_config.max_da_tx_size() { | ||
// Panic indicate max_da_tx_size misconfiguration | ||
assert!(tx_da_limit >= builder_tx_da_size as u64); |
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.
is this copied from the payload builder in reth? wondering if there should be an error log as well here
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.
No, this little piece is mine
I'll add a message, thank you!
self.builder_signer() | ||
.map(|signer| { | ||
let base_fee = self.base_fee(); | ||
// Create message with block number for the builder to sign | ||
let nonce = db | ||
.load_cache_account(signer.address) | ||
.map(|acc| acc.account_info().unwrap_or_default().nonce) | ||
.map_err(|_| { | ||
PayloadBuilderError::other(OpPayloadBuilderError::AccountLoadFailed( | ||
signer.address, | ||
)) | ||
})?; | ||
|
||
// Create the EIP-1559 transaction | ||
let eip1559 = OpTypedTransaction::Eip1559(TxEip1559 { | ||
chain_id: self.chain_id(), | ||
nonce, | ||
gas_limit: builder_tx_gas, | ||
max_fee_per_gas: base_fee.into(), | ||
max_priority_fee_per_gas: 0, | ||
to: TxKind::Call(Address::ZERO), | ||
// Include the message as part of the transaction data | ||
input: message.into(), | ||
..Default::default() | ||
}); | ||
let tx = eip1559; | ||
// Sign the transaction | ||
let builder_tx = signer.sign_tx(tx).map_err(PayloadBuilderError::other)?; |
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.
duplicated code here, can encapsulate into a get_signed_builder_tx
function
Move builder tx creation to dedicated function
📝 Summary
New witness calculation algo.
DA config.
Reserve space for builder_tx in block_da_size.
Note:
If da_config.max_da_tx_size is too small, execute function of OpBuilder will panic, because it's improssible to insert builder transaction.
estimate_builder_tx_da_size may be a little bit heavy, maybe we could precompute tx size for builder_tx and reuse it
💡 Motivation and Context
✅ I have completed the following steps:
make lint
make test