Skip to content

feat: ADR-004 (Nakamoto Bonus) - #10

Merged
Pantani merged 89 commits into
release/v0.50.xfrom
Pantani/feat/nakamoto-bonus
Dec 16, 2025
Merged

Pantani merged 89 commits into
release/v0.50.xfrom
Pantani/feat/nakamoto-bonus

Conversation

@Pantani

@Pantani Pantani commented Aug 26, 2025

Copy link
Copy Markdown

@Pantani Pantani self-assigned this Aug 26, 2025
Comment thread api/cosmos/distribution/v1beta1/distribution.pulsar.go Fixed
Comment thread api/cosmos/distribution/v1beta1/query.pulsar.go Fixed
Comment thread api/cosmos/distribution/v1beta1/query.pulsar.go Fixed
Comment thread api/cosmos/distribution/v1beta1/query.pulsar.go Fixed
Comment thread api/cosmos/distribution/v1beta1/query.pulsar.go Fixed
Comment thread x/distribution/types/query.pb.go Fixed
Comment thread x/distribution/types/query.pb.go Fixed
Comment thread x/distribution/types/query.pb.go Fixed
Comment thread x/distribution/types/query.pb.go Fixed
Comment thread x/distribution/types/query.pb.go Fixed
Comment thread x/distribution/keeper/abci.go Outdated
c := sdk.UnwrapSDKContext(ctx)

// dynamically adjust the nakamoto bonus coefficient first.
if err := k.AdjustEta(c); err != nil {

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call
if ctx.BlockHeight() > 1 {
if err := k.AllocateTokens(ctx, previousTotalPower, ctx.VoteInfos()); err != nil {
if c.BlockHeight() > 1 {
if err := k.AllocateTokens(ctx, previousTotalPower, c.VoteInfos()); err != nil {

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call
Comment thread x/distribution/module.go
func (am AppModule) BeginBlock(ctx context.Context) error {
c := sdk.UnwrapSDKContext(ctx)
return BeginBlocker(c, am.keeper)
return am.keeper.BeginBlocker(c)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods

path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call path flow from Begin/EndBlock to a panic call
@Pantani
Pantani marked this pull request as ready for review September 4, 2025 02:57
@github-actions

This comment has been minimized.

@tbruyelle

Copy link
Copy Markdown
Collaborator

Does this PR replace atomone-hub/atomone#182?

@julienrbrt julienrbrt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice work! first walk-trough, i'll check the tests more carefully later today/tomorrow

Comment thread x/distribution/keeper/eta.go Outdated
Comment thread x/distribution/keeper/nakamoto_bonus.go
Comment thread x/distribution/keeper/eta.go Outdated
Comment thread x/distribution/keeper/eta.go Outdated
Comment thread x/distribution/keeper/grpc_query.go Outdated
Comment thread x/distribution/types/params.go Outdated
Comment thread Makefile Outdated
…at/nakamoto-bonus

# Conflicts:
#	Makefile
#	api/cosmos/distribution/v1beta1/distribution.pulsar.go
#	x/distribution/types/query.pb.go
@Pantani
Pantani force-pushed the Pantani/feat/nakamoto-bonus branch from 13d1ae5 to f64aa85 Compare September 13, 2025 00:39
Comment thread x/distribution/migrations/v4/migrate.go Outdated
Co-authored-by: Thomas <thomas.bruyelle@gmail.com>

@tbruyelle tbruyelle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work!

Comment thread x/distribution/keeper/allocation_test.go Outdated
Comment thread x/distribution/keeper/abci_test.go
…at/nakamoto-bonus

# Conflicts:
#	CHANGELOG.md
#	tests/integration/distribution/keeper/msg_server_test.go
#	x/distribution/README.md
#	x/distribution/migrations/v3/json_test.go
#	x/distribution/types/distribution.pb.go
#	x/distribution/types/events.go
#	x/distribution/types/params_test.go
@giunatale

Copy link
Copy Markdown
Collaborator

I think this looks good, aside from the switch to x/epochs there's nothing left to do here it seems.

what do you guys think, should we merge this and do the epochs switch in an independent PR or have the epochs switch be a PR that is merged here and then merge everything altogether?

@Pantani

Pantani commented Dec 16, 2025

Copy link
Copy Markdown
Author

I think this looks good, aside from the switch to x/epochs there's nothing left to do here it seems.

what do you guys think, should we merge this and do the epochs switch in an independent PR or have the epochs switch be a PR that is merged here and then merge everything altogether?

IMHO, we could merge this one and then create a PR for the epochs module changes, since this one is already approved and reviewed.

@Pantani
Pantani added this pull request to the merge queue Dec 16, 2025
Merged via the queue into release/v0.50.x with commit 8018224 Dec 16, 2025
21 of 23 checks passed
@Pantani
Pantani deleted the Pantani/feat/nakamoto-bonus branch December 16, 2025 14:31
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.

6 participants