Skip to content

feat: support directly forward transactions to sequencer #189

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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

yiweichi
Copy link
Member

@yiweichi yiweichi commented Jul 3, 2025

Counterpart of l2geth scroll-tech/go-ethereum#1208.
Related Reth PR: scroll-tech/reth#265

Added a new flags on NetworkArgs.
network.sequencer-url: This will be passed to ScrollEthApiBuilder, If not None, Reth will forward transactions to sequencer's RPC directly.

@yiweichi yiweichi requested review from frisitano and greged93 July 6, 2025 20:02
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

Added comment inline.

Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

Can we add an e2e test for this using the test framework. See example provided:

#[tokio::test]
async fn can_sequence_and_gossip_blocks() {

@yiweichi
Copy link
Member Author

yiweichi commented Jul 9, 2025

Can we add an e2e test for this using the test framework. See example provided:

#[tokio::test]
async fn can_sequence_and_gossip_blocks() {

Sure, let me do that.

@frisitano
Copy link
Collaborator

Sure, let me do that.

Thanks, I think you'll need to set no_local_transactions_propagation to true in the node config when launching the test nodes:

https://github.com/scroll-tech/reth/blob/766dd271b0bd71315cef665d1eeb81ab86b891e0/crates/node/core/src/args/txpool.rs#L90-L92

@yiweichi
Copy link
Member Author

Sure, let me do that.

Thanks, I think you'll need to set no_local_transactions_propagation to true in the node config when launching the test nodes:

https://github.com/scroll-tech/reth/blob/766dd271b0bd71315cef665d1eeb81ab86b891e0/crates/node/core/src/args/txpool.rs#L90-L92

During testing, the arg no_local_transactions_propagation does't work well, I think it is a bug on Reth, see the fix commit here. Essentially Reth does't pass no_local_transactions_propagation to TransactionValidationTaskExecutor but just put a default value. Which makes even with arg no_local_transactions_propagation set to true, the node will still propagate transaction.

@yiweichi yiweichi requested a review from frisitano July 25, 2025 15:13
Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

Looks good. Left a few minor comments inline. Lets work on getting feat-forward-tx-to-sequencer merged into scroll branch on reth and then we can look to get this merged.

Comment on lines +27 to +30
docker-compose/grafana_data/
docker-compose/l2reth/
docker-compose/prometheus_data/
docker-compose/l1devnet/
Copy link
Collaborator

Choose a reason for hiding this comment

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

The docker-compose volume pattern has changed to use a volumes folder to group the different volume mounts. See below:

- ./volumes/l1devnet:/l1devnet

I think we can use ignore everything in docker-compose/volumes/

@@ -316,6 +316,20 @@ pub struct NetworkArgs {
/// A bool that represents if the scroll wire protocol should be enabled.
#[arg(long = "network.scroll-wire", default_value_t = true)]
pub enable_scroll_wire: bool,
/// A bool that represents if the transaction receiving should be disabled.
Copy link
Collaborator

Choose a reason for hiding this comment

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

line comment no longer relevant.

// Create the chain spec for scroll mainnet with Euclid v2 activated and a test genesis.
let chain_spec = (*SCROLL_DEV).clone();
let (mut sequencer_node, _tasks, _) =
setup_engine(sequencer_node_config, 1, chain_spec.clone(), false, false).await.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we also disable transaction gossip on the sequencer by setting no_local_transactions_propagation to true? I don't think it will have any functional implications on the test but I was wondering why you didn't set it to true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants