forked from near/nearcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove sending witness-ack message to self and forward message to sel…
…f+chunk producer (near#11494) Related issues: near#11491, near#11487 State witness is distributed to chunk validators in two phases: Phase 1) Chunk producer sends one partial state witness to each of the other validators. Phase 2) Each validator forwards the partial state witness it receives to the all validators. Note that, the chunk producer immediately sends chunk-endorsement to the block producer, so it does not need to receive and validate witnesses. Given that, this change includes the following change: 1) [Phase 1] Make the chunk producer NOT send partial state witness to itself. 2) [Phase 2] Make the chunk validator NOT forward partial state to (a) itself and (b) the chunk producer. 3) Do not send witness ack message to the same originating chunk producer (since ack is mainly used for network roundtrip measurements). The only functional change here is (2-b) and sending a message to self is no-op, since the network stack drops messages routed to the same validator. However, first, I think explicitly not sending messages makes it clearer to understand what messages we send and to where. Also, it will not create errors or confusion, if, in the future, we decide to not drop such messages at the network layer but actually process them. Second, test-loop gives warnings when there is a message to self, when simulating the network stack. I am changing the warnings to assertions to keep this as invariant. **Update:** Change (1) also eliminates the following warning that we see in the logs: `Received duplicate or redundant partial state witness part.` This would only happen (in contrary to what is said above) if the network layer does not actually drop the message to self?
- Loading branch information
1 parent
9a72275
commit fe5a71c
Showing
5 changed files
with
159 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.