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

RPC Server: pushTransaction and pushHighPriorityTransaction methods broadcast the transaction #3186

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

Eligioo
Copy link
Member

@Eligioo Eligioo commented Dec 9, 2024

What's in this pull request?

By only pushing the transaction into the local mempool, the transaction never gets adopted if the node itself isn't an elected block producer.

This fixes #3131.

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

rpc-server/src/dispatchers/mempool.rs Outdated Show resolved Hide resolved
rpc-server/src/dispatchers/mempool.rs Outdated Show resolved Hide resolved
rpc-interface/src/mempool.rs Outdated Show resolved Hide resolved
rpc-interface/src/mempool.rs Outdated Show resolved Hide resolved
@sisou
Copy link
Member

sisou commented Dec 9, 2024

I'd rather this get fixed with mempool syncing (#2832).

@Eligioo
Copy link
Member Author

Eligioo commented Dec 10, 2024

I'd rather this get fixed with mempool syncing (#2832).

The goal of PR #2832 is for nodes that just reached consensus get an idea of what the current mempool landscape is it in that moment in time and try to acquire as much of that state. It's not a mechanism to keep mempools in sync in between nodes forever as the mempool in general is an unsynced component. Therefore that PR isn't going to fix #3131.

As stated in the PR description, the Mempool Syncer terminates itself after a fixed amount of time and from there on the node relies on broadcasts done over the network in order to acquire new transactions.

@sisou
Copy link
Member

sisou commented Dec 10, 2024

Then I have the same feedback as JD: The push* methods should push to local mempool first, and then only if it succeeded, broadcast to other peers, too. Because the push* methods are the only way to see if a transaction is currently valid - just broadcasting does not provide any feedback on tx validity.

@Eligioo
Copy link
Member Author

Eligioo commented Dec 10, 2024

@sisou yes I realised the distinction later on too. Basically now in this PR sendRawTransaction and push* have become exactly the same. Will update it.

@Eligioo Eligioo force-pushed the stefan/send-rpc-push-txn branch from b350d94 to c94e535 Compare December 10, 2024 13:23
@Eligioo Eligioo requested a review from jsdanielh December 10, 2024 13:29
Copy link
Member

@jsdanielh jsdanielh left a comment

Choose a reason for hiding this comment

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

LGTM

@jsdanielh jsdanielh force-pushed the stefan/send-rpc-push-txn branch from c94e535 to e908521 Compare December 12, 2024 22:15
…ds broadcast the transaction instead of only pushing it into the local mempool

By only pushing the transaction into the local mempool, the transaction never gets adopted if the node itself isn't an elected block producer.
@jsdanielh jsdanielh force-pushed the stefan/send-rpc-push-txn branch from e908521 to be1fd4a Compare December 12, 2024 22:16
@jsdanielh jsdanielh merged commit be1fd4a into albatross Dec 12, 2024
8 checks passed
@jsdanielh jsdanielh deleted the stefan/send-rpc-push-txn branch December 12, 2024 23:40
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.

Transactions broadcasted with pushTransaction are not included in the chain
3 participants