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

Add support for transaction_v1_broadcast #1724

Merged
merged 4 commits into from
Mar 15, 2024
Merged

Add support for transaction_v1_broadcast #1724

merged 4 commits into from
Mar 15, 2024

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Mar 15, 2024

Adds support for the new JSON-RPC API functions.

This is implemented by adding a new detached boolean when adding a transaction to the transactions service, that indicates whether the transaction stays alive if all of its events receivers are dropped.

When it comes to the JSON-RPC service, we mostly use the same code paths as transactionWatch.
If a transaction of transaction_v1_broadcast is dropped for reasons such as a warp sync or a crash in the service, we immediately re-submit it to the transactions service. This forces the JSON-RPC service to maintain a separate copy of the transaction's bytes, which might seem like a hack, but given that the transactions service can crash there's no way around that anyway.
If a transaction of transaction_v1_broadcast is dropped for other reasons, such as being invalid, we don't re-submit it.

Note that I haven't tested the new code at all, as I can't really write tests that submit a transaction (don't want tests to cost money to run!). Since the code is mostly the existing code with some adjustments, chances are high that it's working.

Work time: 1h

@tomaka tomaka added this pull request to the merge queue Mar 15, 2024
Merged via the queue into smol-dot:main with commit 8517939 Mar 15, 2024
21 checks passed
@tomaka tomaka deleted the tx-v1 branch March 15, 2024 12:50
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