-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-5433] Move costly checks from the critical path
In gossip, when a message that contains a block is sent to a peer (or a peer requests a block) - we consult the MessageCryptoService and ask it- is the given peer (that is considered to receive the block from us) among the channel readers. The problem is that this operation involves verifying ECDSA signatures and it is in the critical path of the dissemination. This commit moves the policy checks from the critical path to the time when the stateInfo messages that are used to verify the peers eligibility are being put into the in-memory cache: - Whenever the StateInfo message is attempted to be added into the in-memory cache, it is checked that the peer that signed it- is a channel reader and is in the channel - Whenver a config updates is received, all messages in the in-memory cache are validated, and if some are found to be invalid - they are deleted from the cache. With this commit: whenever the channel module is asked whether a given peer is eligible of receiving blocks, it simply does a lookup in the in-memory cache of StateInfo messages. More details can be found in the JIRA item. Change-Id: Id5c447e2ad221b3d5276bfc0e878e403ec73a5d3 Signed-off-by: yacovm <yacovm@il.ibm.com>
- Loading branch information
Showing
2 changed files
with
197 additions
and
10 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