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

Transactions broadcasted with pushTransaction are not included in the chain #3131

Open
Elyniss opened this issue Nov 22, 2024 · 4 comments · May be fixed by #3186
Open

Transactions broadcasted with pushTransaction are not included in the chain #3131

Elyniss opened this issue Nov 22, 2024 · 4 comments · May be fixed by #3186

Comments

@Elyniss
Copy link

Elyniss commented Nov 22, 2024

Description

While implementing transaction broadcasting to the chain, I encountered an issue where transactions sent via the pushTransaction RPC method were not included in the chain. Although the response includes the transaction hash, this hash cannot be found in the explorer.

Sample data

RPC request with pushTransaction method:

{"id":0,"method":"pushTransaction","params":["0000d40e2da392a93f524b6c60f9c0879702c80a9662ede05453c7398fdb0aa25df953b859d551a98166eec8f4464d11bd92dd5be4140000000000000001000000000000012c003890a5185e9424ae16f0c4be1388745313dbaa7f840bfaa891190e008529e1e99965586c94a0469f3b0d82d2cc063a96f074bffb489429c896dc6b1d72cb29fbb88ae708"],"jsonrpc":"2.0"}

RPC request with sendRawTransaction method:

{"id":0,"method":"sendRawTransaction","params":["0000d40e2da392a93f524b6c60f9c0879702c80a9662ede05453c7398fdb0aa25df953b859d551a98166eec8f4464d11bd92dd5be4140000000000000001000000000000012c003890a5185e9424ae16f0c4be1388745313dbaa7f840bfaa891190e008529e1e99965586c94a0469f3b0d82d2cc063a96f074bffb489429c896dc6b1d72cb29fbb88ae708"],"jsonrpc":"2.0"}

Workaround

Since the pushTransaction method performs a validity check on the transaction, I will continue using it. However, upon receiving a successful response with the transaction hash, I will follow up with an additional RPC request using the sendRawTransaction method with the same data. This ensures the transaction is included in the chain.

Assumptions

Both RPC requests will generate and return the same transaction hash.

@sisou
Copy link
Member

sisou commented Nov 22, 2024

@styppo Is this due to the mempool syncer not yet implemented? #2832 🤯

@paberr
Copy link
Member

paberr commented Nov 22, 2024

  • pushTransaction seems to put it into our own mempool
  • sendRawTransaction broadcasts it on the network

@sisou
Copy link
Member

sisou commented Nov 22, 2024

Yes, exactly. But pushTransaction should then sync it to other nodes via mempool syncing, but that's not available yet.

@Eligioo
Copy link
Member

Eligioo commented Dec 9, 2024

The behaviours of pushTransaction and pushHighPriorityTransaction have been incorrect such that these methods assumed that the mempool was eventually responsible for broadcasting the transaction to the network.

Because of this, transactions that get pushed only into in the local mempool of a node that isn't an elected block producer, wouldn't never make it in a block. My PR changed this.

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