-
Notifications
You must be signed in to change notification settings - Fork 579
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
updates sync service to submit transaction gossip to api #3926
Conversation
moves 'syncBlocks' to a separate method defines 'syncTransactionGossip' method to invoke the 'event/onTransactionGossip' RPC and submit transactions to the API updates 'sync' to run both of these methods in coroutines updates 'webApi' with a 'transactions' method. matches transaction serialization with serialization from 'followChainStream' for transactions submitted to API with blocks.
f75ce7d
to
94c8029
Compare
|
||
async function commit(): Promise<void> { | ||
await api.transactions(buffer) | ||
buffer.length = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this actually clear the buffer? Never seen this before. I guess that's what it was in the block code before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this looks a bit odd 🤔
copied from the existing syncer code, but i'll take a closer look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will clear the array without replacing it: https://stackoverflow.com/a/1232046
Looks mostly good to me. I think we can test this on the testnet first for integration testing |
* updates sync service to submit transaction gossip to api moves 'syncBlocks' to a separate method defines 'syncTransactionGossip' method to invoke the 'event/onTransactionGossip' RPC and submit transactions to the API updates 'sync' to run both of these methods in coroutines updates 'webApi' with a 'transactions' method. matches transaction serialization with serialization from 'followChainStream' for transactions submitted to API with blocks. * reuses client between sync methods * adds expiration to api transaction writes
Summary
moves 'syncBlocks' to a separate method
defines 'syncTransactionGossip' method to invoke the 'event/onTransactionGossip' RPC and submit transactions to the API
updates 'sync' to run both of these methods in coroutines
updates 'webApi' with a 'transactions' method. matches transaction serialization with serialization from 'followChainStream' for transactions submitted to API with blocks.
Testing Plan
manual testing: ran syncer locally and synced transaction to testnet api: 5c1fa0c851957d46585addf64567fb6ab93f980d23d0d698a6ab49cfc2eb7e1b
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.