Skip to content

Sf 1.11.0#7242

Closed
raduchis wants to merge 56 commits into
rc/supernovafrom
SF-1.11.0
Closed

Sf 1.11.0#7242
raduchis wants to merge 56 commits into
rc/supernovafrom
SF-1.11.0

Conversation

@raduchis

Copy link
Copy Markdown
Contributor

Reasoning behind the pull request

Proposed changes

Testing procedure

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

log.Warn("epochfastforward rounds per epoch too small", "rounds", roundsPerEpoch, "minRoundModulus", minRoundModulus)
roundsPerEpochUint = minRoundModulus
}

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of a signed 64-bit integer from
strconv.ParseInt
to a lower bit size type int without an upper bound check.

Copilot Autofix

AI 7 months ago

To fix the problem, before converting epochs (int64) to int, explicitly check that its value is within the valid range for int on the current platform.

  • The correct range for int can be obtained in Go by using math.MaxInt and math.MinInt.
  • If epochs is out of range, ignore the input or set it to a default/safe value (e.g., 0 or some reasonable fallback).
  • Add import "math" at the top if not already present (it's already imported).

Specifically:

  • In process/block/metablock.go, in the method epochsFastForward, after parsing epochs, check if it fits into an int (i.e., epochs >= math.MinInt && epochs <= math.MaxInt).
  • Only then assign mp.nrEpochsChanges = int(epochs). Otherwise, log an error/warning, and assign a safe default (e.g., 0).

Suggested changeset 1
process/block/metablock.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/process/block/metablock.go b/process/block/metablock.go
--- a/process/block/metablock.go
+++ b/process/block/metablock.go
@@ -2823,7 +2823,12 @@
 		roundsPerEpochUint = minRoundModulus
 	}
 
-	mp.nrEpochsChanges = int(epochs)
+	if epochs >= int64(math.MinInt) && epochs <= int64(math.MaxInt) {
+		mp.nrEpochsChanges = int(epochs)
+	} else {
+		log.Error("epochfastforward", "epochs value out of int range", epochs)
+		mp.nrEpochsChanges = 0
+	}
 	mp.roundsModulus = roundsPerEpochUint
 
 	log.Warn("epochfastforward - forcing epoch start", "round", metaHdr.GetRound(), "epoch", metaHdr.GetEpoch(), "still remaining epoch changes", mp.nrEpochsChanges, "rounds modulus", mp.roundsModulus)
EOF
@@ -2823,7 +2823,12 @@
roundsPerEpochUint = minRoundModulus
}

mp.nrEpochsChanges = int(epochs)
if epochs >= int64(math.MinInt) && epochs <= int64(math.MaxInt) {
mp.nrEpochsChanges = int(epochs)
} else {
log.Error("epochfastforward", "epochs value out of int range", epochs)
mp.nrEpochsChanges = 0
}
mp.roundsModulus = roundsPerEpochUint

log.Warn("epochfastforward - forcing epoch start", "round", metaHdr.GetRound(), "epoch", metaHdr.GetEpoch(), "still remaining epoch changes", mp.nrEpochsChanges, "rounds modulus", mp.roundsModulus)
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
Base automatically changed from feat/sub-second-round to rc/supernova October 2, 2025 07:46
@github-actions

Copy link
Copy Markdown

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: c8e1a7224a2614ed9044a6ed246c7036d0b2d902
  • Current Branch: SF-1.11.0
  • mx-chain-go Target Branch: rc/supernova
  • mx-chain-simulator-go Target Branch: rc/supernova
  • mx-chain-testing-suite Target Branch: rc/supernova
  • mx-chain-simulator-go Commit Hash: f34782597c2b84fd11d91a937138749429b794e4

🚀 Environment Variables:

  • TIMESTAMP: 2025_NOVEMBER_14__09_48_13
  • PYTEST_EXIT_CODE: 1

@github-actions

Copy link
Copy Markdown

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 4fc176ab8e16fd0207b9479bcaaec06cf1221995
  • Current Branch: SF-1.11.0
  • mx-chain-go Target Branch: rc/supernova
  • mx-chain-simulator-go Target Branch: rc/supernova
  • mx-chain-testing-suite Target Branch: rc/supernova
  • mx-chain-simulator-go Commit Hash: f34782597c2b84fd11d91a937138749429b794e4

🚀 Environment Variables:

  • TIMESTAMP: 2025_NOVEMBER_14__13_45_00
  • PYTEST_EXIT_CODE: 1

@github-actions

Copy link
Copy Markdown

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 5c6ed04de1b35a13f39e5f0a6747010a35a0dd53
  • Current Branch: SF-1.11.0
  • mx-chain-go Target Branch: rc/supernova
  • mx-chain-simulator-go Target Branch: rc/supernova
  • mx-chain-testing-suite Target Branch: rc/supernova
  • mx-chain-simulator-go Commit Hash: c28e818824f15403ae81910e0de78a919b4e15bb

🚀 Environment Variables:

  • TIMESTAMP: 2025_NOVEMBER_25__08_19_41
  • PYTEST_EXIT_CODE: 1

@github-actions

Copy link
Copy Markdown

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: 8a9a913dd50b92ace89cf5e2fe0db0a8f3d85c5e
  • Current Branch: SF-1.11.0
  • mx-chain-go Target Branch: rc/supernova
  • mx-chain-simulator-go Target Branch: rc/supernova
  • mx-chain-testing-suite Target Branch: rc/supernova
  • mx-chain-simulator-go Commit Hash: c28e818824f15403ae81910e0de78a919b4e15bb

🚀 Environment Variables:

  • TIMESTAMP: 2025_NOVEMBER_25__11_57_42
  • PYTEST_EXIT_CODE: 1

@raduchis raduchis closed this Nov 26, 2025
@raduchis raduchis deleted the SF-1.11.0 branch November 26, 2025 17:44
@github-actions

Copy link
Copy Markdown

Integration Tests completed with failures or errors.

📊 MultiversX Automated Test Report: View Report

🔄 Build Details:

  • mx-chain-go Commit Hash: b99ebe54479002fdd2426e561eb5a70ed3e5fe07
  • Current Branch: SF-1.11.0
  • mx-chain-go Target Branch: rc/supernova
  • mx-chain-simulator-go Target Branch: rc/supernova
  • mx-chain-testing-suite Target Branch: rc/supernova
  • mx-chain-simulator-go Commit Hash: c28e818824f15403ae81910e0de78a919b4e15bb

🚀 Environment Variables:

  • TIMESTAMP: 2025_NOVEMBER_27__01_56_22
  • PYTEST_EXIT_CODE: ``

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