Skip to content

Finality forks fix#2013

Merged
esuwu merged 10 commits intodetermenistic-finality-featurefrom
finality-forks-fix
Feb 27, 2026
Merged

Finality forks fix#2013
esuwu merged 10 commits intodetermenistic-finality-featurefrom
finality-forks-fix

Conversation

@esuwu
Copy link
Contributor

@esuwu esuwu commented Feb 26, 2026

No description provided.

@esuwu esuwu requested a review from alexeykiselev February 26, 2026 14:30
Comment on lines +324 to +326
if endorseErr := a.Endorse(block.Parent, height, pk, sk); endorseErr != nil {
return a.Errorf(errors.Wrapf(err, "failed to endorse parent block"))
}

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.rules.if-incorrect-nil-err-return Warning

WARNING: A local variable 'endorseErr' is checked for nil, but a different variable is returned.
Ensure that the returned variable is the one that was checked or properly wrapped!
Comment on lines +324 to +326
if endorseErr := a.Endorse(block.Parent, height, pk, sk); endorseErr != nil {
return a.Errorf(errors.Wrapf(err, "failed to endorse parent block"))
}

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: semgrep.rules.if-inplace-func-incorrect-nil-err-return Warning

WARNING: A local variable 'endorseErr' is checked for nil, but a different variable is returned.
Ensure that the returned variable is the one that was checked or properly wrapped!
"encoding/base64"
stderrs "errors"
"fmt"
"math/rand/v2"

Check warning

Code scanning / Semgrep OSS

Semgrep Finding: go.lang.security.audit.crypto.math_random.math-random-used Warning test

Do not use math/rand. Use crypto/rand instead.
@@ -1318,8 +1346,8 @@
// See `balances.generateLeaseBalanceSnapshotsForLeaseOverflows` for details
newLeaseBalance := proto.LeaseBalanceSnapshot{
Address: wavesAddress,
LeaseIn: uint64(fullBalance.leaseIn + diffAmount.leaseIn.Value()),
LeaseOut: uint64(fullBalance.leaseOut + diffAmount.leaseOut.Value()),
LeaseIn: uint64(fullBalance.LeaseIn + diffAmount.leaseIn.Value()), //nolint:gosec // As described above.

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int64 -> uint64
LeaseIn: uint64(fullBalance.leaseIn + diffAmount.leaseIn.Value()),
LeaseOut: uint64(fullBalance.leaseOut + diffAmount.leaseOut.Value()),
LeaseIn: uint64(fullBalance.LeaseIn + diffAmount.leaseIn.Value()), //nolint:gosec // As described above.
LeaseOut: uint64(fullBalance.LeaseOut + diffAmount.leaseOut.Value()), //nolint:gosec // As described above.

Check failure

Code scanning / gosec

integer overflow conversion uint64 -> uint32 Error

integer overflow conversion int64 -> uint64
@esuwu esuwu changed the base branch from master to determenistic-finality-feature February 26, 2026 23:10
@esuwu esuwu merged commit 4a192c9 into determenistic-finality-feature Feb 27, 2026
9 checks passed
@esuwu esuwu deleted the finality-forks-fix branch February 27, 2026 10:07
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.

1 participant