-
Notifications
You must be signed in to change notification settings - Fork 19
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
TOP pool synchronization #2211
TOP pool synchronization #2211
Conversation
P-100 Linear processing of DI requests
ContextFollowing up on the discussion in #1920 (comment) Imagine there are 100 workers and we send a request to worker0, worker0 happens to just finish the its block production so the newly submitted request won't be included in the block for now. Since we have an aura authorship mechanism, the request can be processed after 100 blocks at the earliest, this sounds terrifying. The root cause is the tx pool of sidechain is not synchronised among nodes, so a DI request can only be stored and processed by the node, to which the request was submitted. It's a critical issue for multi-worker setup, but I don't think we have time to solve it soon, hence the medium prior. ✔️ Please set appropriate labels and assignees if applicable. |
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.
I haven't completed the review yet - only took a rough look. Will go into more details later
The animation is well made btw!
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.
Overall looks good to me, nicely done!
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.
Hey, we definitely want to gossip the top pool. I had a superficial look and this PR looks very nice and clean!
I noticed that you gossip the executed TOP to peers, but this is probably not the mechanism to remove it from the synchronized pool? It is done via the sidechain block import, isn't it?
Maybe @brenzi also wants to chime in here.
Thanks @clangenb for your time and taking a look at this 👍🏼 . Yes, this change doesn't affect how TOP pool is managed (when TOPs are added or removed). It basically only gossips trusted calls to other known peers and routes back selected responses to the caller. All the rest remains the same. RPC client could submit trusted call to all peers in the network separately and the efect would be pretty the same. |
I think you should take care not to gossip getters or inherents. Top pool holds tops (TrustedOperation) which can be getters, indirect or direct TrustedCalls Also, a trusted call can be an inherent/intrinsic(signed by enclave itself) i.e. shield_funds(). These could be gossipped in principle, but we need to think about edge cases |
Hi @brenzi, thanks for your advices, here are my thoughts:
We can add filtering logic to |
I've moved broadcasting triggering point from json-rpc method to
|
Thank you - I like the incorporation of And yes I don't think we need to broadcast all kinds of trusted operations:
So I'd say for now we only broadcast direct trusted calls. |
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.
Looks good, let's merge it.
BroadcastedTopFilter
is passed in as DirectCallsOnlyFilter
to initialisation AFAIU, isn't it
Yes, this will ensure only direct calls are broadcasted to peers. |
Trusted getters are not added to TOP pool due to filters applied :
|
Context
resolves: #1935
resolves: P-100
This PR attempts to add TOP pool synchronization through direct trusted rpc server. Trusted calls should be eventually broadcasted to other registered workers and optimistically picked and executed by next block producer.
Changes:
author_submitAndWatchExtrinsic
JSON-RPC method broadcasts trusted call to other peersauthor_submitAndWatchBroadcastedExtrinsic
JSON-RPC method which acts asauthor_submitAndWatchExtrinsic
but doesn't broadcast trusted callsTrustedOperationStatus::TopExecuted
which is fired upon TOP execution (breaking change)get_trusted_peers_urls
in order pull trusted peers urls from worker service to enclave runtime