-
Notifications
You must be signed in to change notification settings - Fork 17
fixed gaps #553
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
base: hotfix2-rc
Are you sure you want to change the base?
fixed gaps #553
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5133,7 +5133,7 @@ class TransactionQueue { | |||||||||||||||||||||||
| /* prettier-ignore */ if (logFlags.verbose) this.mainLogger.debug(`factTellCorrespondingNodesFinalData: Using wrapped index ${wrappedIndex} instead of regular ${senderIndexInTxGroup}`) | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (configContext.p2p.factv2) senderIndex = queueEntry.transactionGroup.findIndex((node) => node.id === Self.id) | ||||||||||||||||||||||||
| if (configContext.p2p.factv2) senderIndex = queueEntry.executionGroup.findIndex((node) => node.id === Self.id) | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Calculate corresponding nodes using the correct index that receivers will validate | ||||||||||||||||||||||||
| const correspondingIndices = getCorrespondingNodes( | ||||||||||||||||||||||||
|
|
@@ -5314,6 +5314,7 @@ class TransactionQueue { | |||||||||||||||||||||||
| let targetEndIndex = queueEntry.transactionGroup.length // end of tx group | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (configContext.p2p.factv2) { | ||||||||||||||||||||||||
| senderNodeIndex = queueEntry.executionGroup.findIndex((node) => node.id === senderNodeId) | ||||||||||||||||||||||||
| targetNodeIndex = queueEntry.transactionGroup.findIndex((node) => node.id === Self.id) | ||||||||||||||||||||||||
| targetEndIndex = targetEndIndex - 1 | ||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||
|
Comment on lines
5316
to
5320
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Assigning
Suggested change
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,9 @@ export function getCorrespondingNodes( | |
| //this loop is at most O(k) where k is receiverGroupSize / sendGroupSize | ||
| //effectively it is constant time it is required so that a smaller | ||
| //group can send to a larger group | ||
| while (targetNumber < receiverGroupSize) { | ||
| let steps = 0 | ||
| const maxSteps = v2 ? Math.ceil(receiverGroupSize / sendGroupSize) : Infinity | ||
| while (v2 ? steps < maxSteps : targetNumber < receiverGroupSize) { | ||
| //send all payload to this node | ||
| const destinationNode = wrappedIndex | ||
|
|
||
|
Comment on lines
+55
to
60
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The New proposed code: let steps = 0
const maxSteps = v2 ? Math.ceil(receiverGroupSize / sendGroupSize) : Infinity
while (v2 ? steps < maxSteps : targetNumber < receiverGroupSize) {
//send all payload to this node
+ if (wrappedIndex >= transactionGroupSize) {
+ wrappedIndex = wrappedIndex - transactionGroupSize
+ }
const destinationNode = wrappedIndex
destinationNodes.push(destinationNode) |
||
|
|
@@ -77,6 +79,7 @@ export function getCorrespondingNodes( | |
| if (wrappedIndex >= transactionGroupSize) { | ||
| wrappedIndex = wrappedIndex - transactionGroupSize | ||
| } | ||
| steps++ | ||
| if (!v2) { | ||
| //wrap to front of receiver group | ||
| if (wrappedIndex >= endTargetIndex) { | ||
|
|
||
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.
Suggestion: Overwriting
senderIndexhere may conflict with the earlier assignment fromwrappedIndex, potentially causing inconsistency if both conditions are true. Add a check to ensure only one assignment path is taken, or clarify precedence to avoid logic errors. [possible issue, importance: 7]