-
Notifications
You must be signed in to change notification settings - Fork 8
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
SHARD-44: GlobalTx fixes #103
Conversation
src/Data/Collector.ts
Outdated
@@ -73,6 +73,11 @@ | |||
executionGroupNodes: ConsensusNodeInfo[], | |||
minConfirmations: number = config.RECEIPT_CONFIRMATIONS | |||
): Promise<{ success: boolean; newReceipt?: Receipt.ArchiverReceipt }> => { | |||
// If robustQuery is disabled, do offline verification | |||
if (!config.useRobustQueryForReceipt) { |
Check failure
Code scanning / CodeQL
User-controlled bypass of security check High
action
user-provided value
793f574
to
c131ed4
Compare
f29133e
to
cf6a9e3
Compare
if (nestedCountersInstance) | ||
nestedCountersInstance.countEvent( | ||
'receipt', | ||
'Invalid_receipt_globalModification_valid_signs_count_less_than_votingGroupCount' |
Check failure
Code scanning / CodeQL
User-controlled bypass of security check High
action
user-provided value
56d1083
to
832bdec
Compare
82ce0d0
to
780ed88
Compare
The base branch was changed.
@S0naliThakur Since we have disabled the workers. We can also comment out the code where we are initializing and setting up the worker process. Please refer to these lines -
CC: @aniketdivekar |
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.
Please comment out the initWorkerProcess and setupWorkerProcesses methods.
|
||
const nodeMap = new Map<string, P2PTypes.NodeListTypes.Node>() | ||
// Fill the map with nodes keyed by their public keys | ||
cycleShardData.nodes.forEach((node) => { |
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 think it would be ok to just put the nodeMap on the cycleShardData the first time we compute it (lazy init)
that does not need to change to merge this. I suspect we will do a more general perf pass later as time permits.
} | ||
// Check if the node is in the execution group | ||
if (!cycleShardData.parititionShardDataMap.get(homePartition).coveredBy[node.id]) { | ||
Logger.mainLogger.error( |
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 think in the future we should generally be putting log lines behind if checks like in the validator. This is because even if you don't log it you still pay the string format cost.
(this is not a blocker though)
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 do have some logger pattern upgrades to share later anyhow.
for (const signature of normalReceipt.signaturePack) { | ||
if (!signature || !signature.owner) continue | ||
|
||
const node = executionGroupNodes.find((n) => n.publicKey.toLowerCase() === signature.owner.toLowerCase()) |
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.
when we later do a perf pass a map would avoid O(n^2)
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 made a few small comments but they are not show stoppers to get into dev. I think the testing and roll out plans will be critical for this
…loadReceipt, improved error logs, deprecated setupWorkerProcesses and offloadReceipt.
…rchiverReceipt types
6fc1783
d271eb0
to
6fc1783
Compare
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 now
Linear: https://linear.app/shm/issue/SHARD-44/globaltx-validation
Summary: Implement global receipt validation and enhance receipt verification logic
useRobustQueryForReceipt
flagstoreReceipt
method to useverifyArchiverReceipt
directly.verifyGlobalTxreceiptOffline
andverifyReceiptMajority
for better code readability.