Skip to content
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

Open
wants to merge 4 commits into
base: itn4
Choose a base branch
from
Open

SHARD-44: GlobalTx fixes #103

wants to merge 4 commits into from

Conversation

S0naliThakur
Copy link
Member

@S0naliThakur S0naliThakur commented Nov 21, 2024

Linear: https://linear.app/shm/issue/SHARD-44/globaltx-validation

Summary: Implement global receipt validation and enhance receipt verification logic

  1. Put archiver robust query behind useRobustQueryForReceipt flag
  2. Integrated AJV schema validation for global receipts across multiple modules.
  3. Improved error handling and logging for receipt validation processes.
  4. Updated AJV schema enumeration to include GlobalTxReceipt.
  5. Modified storeReceipt method to use verifyArchiverReceipt directly.
  6. Added functions for verifying global receipts, including verifyGlobalTxreceiptOffline and verifyReceiptMajority for better code readability.
  7. Refactored existing receipt verification methods to support both global and non-global receipts.

@@ -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

This condition guards a sensitive
action
, but a
user-provided value
controls it.
@S0naliThakur S0naliThakur force-pushed the globalTx-fixes branch 2 times, most recently from 793f574 to c131ed4 Compare November 26, 2024 16:39
@S0naliThakur S0naliThakur marked this pull request as ready for review November 26, 2024 16:41
src/Data/Collector.ts Outdated Show resolved Hide resolved
src/Data/Collector.ts Outdated Show resolved Hide resolved
src/Data/Collector.ts Show resolved Hide resolved
src/Data/Collector.ts Outdated Show resolved Hide resolved
@S0naliThakur S0naliThakur force-pushed the globalTx-fixes branch 2 times, most recently from f29133e to cf6a9e3 Compare December 12, 2024 14:07
src/Data/Collector.ts Dismissed Show dismissed Hide dismissed
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

This condition guards a sensitive
action
, but a
user-provided value
controls it.
This condition guards a sensitive action, but a
user-provided value
controls it.
This condition guards a sensitive action, but a
user-provided value
controls it.
@S0naliThakur S0naliThakur changed the base branch from dev to itn4 December 13, 2024 06:28
…loadReceipt, improved error logs, deprecated setupWorkerProcesses and offloadReceipt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants