Skip to content
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

draft(optimism): sendRawTransactionConditional #13926

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hamdiallam
Copy link

@hamdiallam hamdiallam commented Jan 22, 2025

Leaving a few comments in the different places that might require changes. Will flesh out an implementation after a soft approval/guidance in the right direction

  1. OpTransactionSigned / OpPooledTransaction. References to conditional and notion of rejected

    • The builder interfaces with OpTransactionSigned. We need reference to the conditional to validate during execute_best_transactions and a means to invalidate from the pool.
  2. L2EthApiExt & OpTransactionSigned: Can the conditional be attached as an optional field on the deserialized tx? This way pool::add_transaction is simply used. Or should a pool wrapper have a separate interface for submission.

  3. PoolWrapper -> If we wrap the Pool interface, should this filter out the rejected txs and in a background task remove them from the pool?

    • We could implement the validation logic in validate_one which would duplicate the conditional checks

@emhane emhane added A-block-building Related to block building A-tx-pool Related to the transaction mempool A-op-reth Related to Optimism and op-reth labels Jan 22, 2025
@@ -10,6 +10,10 @@ pub struct RollupArgs {
#[arg(long = "rollup.sequencer-http", value_name = "HTTP_URL")]
pub sequencer_http: Option<String>,

/// Enable transaction conditional support on sequencer
#[arg(long = "rollup.sequencer-transaction-conditional-enabled", default_value = "false")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's rename this to enable-transaction-conditional

Comment on lines +54 to +55
/// Indiciator if this transaction has been marked as rejected
rejected: AtomicBool // (is AtomicBool appropriate here?)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this for now, because we'll handle eviction differently


/// Optional conditional attached to this transaction. Is this
/// needed if this field is on OpTransactionSigned?
conditional: Option<TransactionConditional>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we need this field here.

this option is also fine because this tx type is always wrapped in an Arc so it's always on the heap anyway

Comment on lines +48 to +50

/// Can we attach a conditional the moment a transaction is deserialized?
pub conditional: Option<TransactionConditional>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this we shouldn't do, because this is a representation fo the actual tx type and shouldn't be annotated with out of protocol data

}

// TEMPORARY since TransactionConditional does not impl eq
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind submitting a pr on alloy for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes definitely

@mattsse mattsse marked this pull request as ready for review January 23, 2025 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-block-building Related to block building A-op-reth Related to Optimism and op-reth A-tx-pool Related to the transaction mempool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants