Oev 618 update max retries logic#276
Merged
Merged
Conversation
jmank88
approved these changes
Oct 17, 2025
cl-efornaciari
approved these changes
Oct 17, 2025
Contributor
cl-efornaciari
left a comment
There was a problem hiding this comment.
LGTM, added a few comments/questions
Comment on lines
-88
to
+91
| attempt.ID = uint64(len(tx.Attempts)) // Attempts are not collectively tracked by the in-memory store so attemptIDs are not unique between transactions and can be reused. | ||
| attempt.ID = uint64(tx.AttemptCount) // Attempts are not collectively tracked by the in-memory store so attemptIDs are not unique between transactions and can be reused. |
Contributor
There was a problem hiding this comment.
why did this change?
Contributor
Author
There was a problem hiding this comment.
After this patch, the length of the attempts slice is finite, but the total number of attempts can exceed that threshold due to pruning. To accurately count them we need to make this switch.
| attempt.ID = uint64(tx.AttemptCount) // Attempts are not collectively tracked by the in-memory store so attemptIDs are not unique between transactions and can be reused. | ||
| tx.AttemptCount++ | ||
| // Prune oldest attempt. | ||
| if len(tx.Attempts) >= MaxAllowedAttempts { |
Contributor
There was a problem hiding this comment.
because of the lock I think its not possible for this to exceed at most 1 attempts over the max allowed attempts, is that correct?
Contributor
Author
There was a problem hiding this comment.
Indeed, that's just safer.
| require.NoError(t, m2.AppendAttemptToTransaction(nonce, newAttempt)) | ||
| } | ||
| tx, _ := m2.FetchUnconfirmedTransactionAtNonceWithCount(nonce) | ||
| fmt.Println("TX:", tx) |
Contributor
There was a problem hiding this comment.
nit: do we want this print here?
Comment on lines
+125
to
+126
| assert.Equal(t, attemptsTried, tx.AttemptCount) | ||
| assert.Equal(t, uint64(attemptsTried-MaxAllowedAttempts), tx.Attempts[0].ID) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements two new changes: