Skip to content

Tags: cometbft/cometbft

Tags

v0.38.20

Toggle v0.38.20's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: add voting power validation (v0.38.x) (#5520)

validates voting power and returns an error instead of panicking 

---

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Switch total voting power computation to return errors instead of
panicking, add a safe accessor, and update callers/tests accordingly.
> 
> - **Types (`types/validator_set.go`)**:
> - Change `updateTotalVotingPower()` to return `error` instead of
panicking on overflow and set `totalVotingPower`.
>   - Add `TotalVotingPowerSafe()` to get TVP with error handling.
> - Update `TotalVotingPower()` to panic only if
`updateTotalVotingPower()` returns an error.
> - Use error-based TVP validation in `updateWithChangeSet()`,
`ValidatorSetFromProto()` (now returns error on bad input), and
`ValidatorSetFromExistingValidators()`.
> - **Tests (`types/validator_set_test.go`)**:
> - Add `TestValidatorSetFromProtoReturnsErrorOnOverflow` to assert
error on TVP overflow from proto input.
> - Update `verifyValidatorSet()` to handle `updateTotalVotingPower()`
error.
>   - Minor import addition for crypto key encoding.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
a66f19f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

v0.37.17

Toggle v0.37.17's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: remove panic (#5525)

removes a panic from code

#### PR checklist

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Replaces panics on total voting power overflow with error returns,
adds a safe accessor, and updates callers and tests accordingly.
> 
> - **types/validator_set.go**:
> - `updateTotalVotingPower` now returns `error` instead of panicking on
overflow; propagates error where applicable.
> - Added `TotalVotingPowerSafe()` to compute/return total voting power
or an error.
> - `TotalVotingPower()` now panics only if `updateTotalVotingPower()`
returns an error.
> - Updated callers: `updateWithChangeSet`, `ValidatorSetFromProto`, and
`ValidatorSetFromExistingValidators` to handle/propagate errors.
> - **tests** (`types/validator_set_test.go`):
>   - Added `TestValidatorSetFromProtoReturnsErrorOnOverflow`.
> - Adjusted tests to handle new error-returning behavior (e.g.,
checking `require.NoError` from `updateTotalVotingPower`).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d7d7ae4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

v0.39.0-beta.2

Toggle v0.39.0-beta.2's commit message

Verified

This tag was signed with the committer’s verified signature.
aljo242 Alex | Cosmos Labs
working beta tag

v0.39.0-beta.1

Toggle v0.39.0-beta.1's commit message

Verified

This tag was signed with the committer’s verified signature.
aljo242 Alex | Cosmos Labs
tag for v0.39

v0.38.19

Toggle v0.38.19's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge commit from fork

* add VaidateBasic to BitArray to ensure Bits and len(Elems) are valid

* call ValidateBasic on BitArrays when receiving as a msg from exteranl nodes

* enfore SetIndex is not setting out of bounds

* add guard to getNumTrueIndices

getNumTrueIndices will index out of bounds if Bits and Elems have a
mismatch where len(elems) != (bits+63)/64, this guard makes it simply
return 0 if this mismatch is present

* changelog

* fix missing import for v0.38.x

* update changelog for release of v0.38.19

* remove duplicate bug fixes from unreleased

* fix changelog date

* fix lint

* fix expected error string in test

v0.37.16

Toggle v0.37.16's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge commit from fork

* add VaidateBasic to BitArray to ensure Bits and len(Elems) are valid

* call ValidateBasic on BitArrays when receiving as a msg from exteranl nodes

* enfore SetIndex is not setting out of bounds

* add guard to getNumTrueIndices

getNumTrueIndices will index out of bounds if Bits and Elems have a
mismatch where len(elems) != (bits+63)/64, this guard makes it simply
return 0 if this mismatch is present

* changelog

* fix missing import for v0.38.x

* update chagnelog for release

* fix changelog date

* bump version.go to 0.37.16 as default

* lint

* fix expected error string in test

v0.39.0-beta.0

Toggle v0.39.0-beta.0's commit message

Verified

This tag was signed with the committer’s verified signature.
aljo242 Alex | Cosmos Labs
beta tag for experimentation

v0.38.18

Toggle v0.38.18's commit message
Release v0.38.18

v2.0.0-rc1

Toggle v2.0.0-rc1's commit message
Release cometbft module v2.0.0-rc1

api/v1.1.0-rc1

Toggle api/v1.1.0-rc1's commit message
Release api module v1.1.0-rc1