Skip to content

fix: increments in upf converter TxNonce calculation#561

Merged
gustavogama-cll merged 1 commit into
mainfrom
ggama/fix-increments-upf-txnonce-calculation
Nov 4, 2025
Merged

fix: increments in upf converter TxNonce calculation#561
gustavogama-cll merged 1 commit into
mainfrom
ggama/fix-increments-upf-txnonce-calculation

Conversation

@gustavogama-cll

Copy link
Copy Markdown
Contributor

The calculation of the txNonce values used by the upf converter was broken. It always added 1 to the expected value. This patch simply moves the increment operation inside the for loop and fixes the respective tests.

@changeset-bot

changeset-bot Bot commented Nov 3, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: dc7cfe5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gustavogama-cll gustavogama-cll force-pushed the ggama/fix-increments-upf-txnonce-calculation branch from 1e9906e to dc7cfe5 Compare November 3, 2025 23:33
@cl-sonarqube-production

Copy link
Copy Markdown

@gustavogama-cll gustavogama-cll marked this pull request as ready for review November 4, 2025 04:31
@gustavogama-cll gustavogama-cll requested review from a team as code owners November 4, 2025 04:31
Copilot AI review requested due to automatic review settings November 4, 2025 04:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in the upf converter's txNonce calculation where values were incorrectly incremented by 1. The fix moves the increment operation inside the for loop to occur after the index check, ensuring nonce values start at 1 instead of 2.

  • Fixed off-by-one error in calculateOpCount function
  • Updated test expectations to reflect correct txNonce values
  • Refactored test helper functions for better reusability

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
experimental/analyzer/upf/upf.go Corrected the order of operations in calculateOpCount to fix txNonce calculation
experimental/analyzer/upf/upf_test.go Updated expected txNonce values in test cases and refactored helper functions
.changeset/beige-sites-lie.md Added changeset documenting the fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gustavogama-cll gustavogama-cll added this pull request to the merge queue Nov 4, 2025
Merged via the queue into main with commit 280ce37 Nov 4, 2025
15 checks passed
@gustavogama-cll gustavogama-cll deleted the ggama/fix-increments-upf-txnonce-calculation branch November 4, 2025 13:25
github-merge-queue Bot pushed a commit that referenced this pull request Nov 4, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## chainlink-deployments-framework@0.63.0

### Minor Changes

-
[#560](#560)
[`ed679a7`](ed679a7)
Thanks [@huangzhen1997](https://github.com/huangzhen1997)! - bump sui
binding version

### Patch Changes

-
[#561](#561)
[`280ce37`](280ce37)
Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - fix:
computation of the txNonce attribute in the upf converter

---------

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
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