Skip to content

perf(internal/state): avoid double-saving FinalizeBlockResponse - #2017

Merged
melekes merged 5 commits into
mainfrom
anton/1976-deduplicate-save-abciresponses
Feb 21, 2024
Merged

melekes merged 5 commits into
mainfrom
anton/1976-deduplicate-save-abciresponses

Conversation

@melekes

@melekes melekes commented Jan 11, 2024 •

Copy link
Copy Markdown
Collaborator

for performance reasons.
Closes #1976


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@melekes
melekes requested a review from a team as a code owner January 11, 2024 06:19
@melekes
melekes requested a review from a team January 11, 2024 06:19
@melekes melekes self-assigned this Jan 11, 2024
@melekes melekes added backport-to-v1.x backport-to-v0.38.x Tell Mergify to backport the PR to v0.38.x and removed backport-to-v1.x labels Jan 11, 2024
@melekes

melekes commented Jan 11, 2024

Copy link
Copy Markdown
Collaborator Author

cc @ValarDragon

@ValarDragon ValarDragon 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.

Amazing tysm! This looks great to me

@cason cason left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Legit.

I wonder if the description should mention the deprecation of the key, and the new way to store/retrieve the last ABCI responses.

Comment thread internal/state/store.go Resolved
Comment thread internal/state/store.go Resolved
@melekes

melekes commented Jan 15, 2024

Copy link
Copy Markdown
Collaborator Author

I wonder if the description should mention the deprecation of the key

And what will be the reason for this? The change is non-breaking. Plus the key is not exported.

and the new way to store/retrieve the last ABCI responses.

The best place for this would probably be the spec, but that is outside of the scope for this PR (spec for state/store doesn't exist).

@cason

cason commented Jan 15, 2024

Copy link
Copy Markdown

You are right. Regarding the documentation of the crash-recovery mechanisms of Comet we have this old, never tackled issue: #493. Because this is a worm hole.

melekes added a commit that referenced this pull request Jan 15, 2024
Comment thread internal/state/store.go
// We always save the last ABCI response for crash recovery.
// If `store.DiscardABCIResponses` is true, then we delete the previous ABCI response.
if store.DiscardABCIResponses && height > 1 {
if err := store.db.Delete(calcABCIResponsesKey(height - 1)); err != nil {

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.

While we do not double save a lot of data, we do have 2 DB operations here. Note that if compaction does not work as expected, this might still be blowing up state.db even though we are deleting data.

If DiscardABCIResponses is true then we could potentially just save everything under LastABCIResponsesKey.
So we have only one key in the DB and don't risk having potentially a big DB due to lack of compaction kicking in.

The changes could look something like this:

func  (store dbStore) LoadLastFinalizeBlockResponse(height int64) (*abci.FinalizeBlockResponse, error) {

.....
var bz
if store.DiscareABCIResponse == true {

    bz, err := store.db.Get(lastABCIResponseKey)
    
 } else {

    bz, err := store.db.Get(calcABCIResponseKey(height))
}
// Perform checks on height

....

Then in

func (store dbStore) SaveFinalizeBlockResponse(height int64, resp*abci.FinalizeBlockResponse) error {

...

var resp 
if store.DiscardABCIResponses == true {
      store.db.SetSync(lastABCIResponseKey, bz)
} else {

  store.db.SetSync(calcLastABCIResponseKey(height), bz)
}

The only potential problem I see is if this setting (DiscardABCIResponses) can be changed between node boot-ups so there might be some additional checks to be added.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

While we do not double save a lot of data, we do have 2 DB operations here. Note that if compaction does not work as expected, this might still be blowing up state.db even though we are deleting data.

Good point 👍 under what conditions compaction does not work as expected?

The only potential problem I see is if this setting (DiscardABCIResponses) can be changed between node boot-ups so there might be some additional checks to be added.

This is a valid concern.

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.

While we do not double save a lot of data, we do have 2 DB operations here. Note that if compaction does not work as expected, this might still be blowing up state.db even though we are deleting data.

Good point 👍 under what conditions compaction does not work as expected?

At the moment (without the changes we plan to introduce with in-process compaction, there is no guarantee that golevleDB will actually compact the storage, the same way it has not been doing so previously for blocks. . This is worth testing out in this case though. If the problem exists, then calling CompactRange after a couple of these delete operations would solve the storage footprint problem.

The only potential problem I see is if this setting (DiscardABCIResponses) can be changed between node boot-ups so there might be some additional checks to be added.

This is a valid concern.

I am not sure this is a problem in your version of the code, only in what I propose.

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.

@melekes , what could be worth running is a small testnet on this branch and monitor the storage usage. Even on one node.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale For use by stalebot label Jan 26, 2024
Comment thread internal/state/store.go
@@ -524,39 +523,43 @@ func (store dbStore) LoadFinalizeBlockResponse(height int64) (*abci.FinalizeBloc
// This method is used for recovering in the case that we called the Commit ABCI
// method on the application but crashed before persisting the results.
func (store dbStore) LoadLastFinalizeBlockResponse(height int64) (*abci.FinalizeBlockResponse, error) {

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.

Not sure I understand the crash scenario fully. And this is the first time I am looking at this code. With the new change if height is smaller than the height of the lastABCIResponseKey it will return stored results (or not found if DiscardABCIResponses was true). Maybe this is not possible in the crash scenario. If that's the case, could you maybe document this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

With the new change if height is smaller than the height of the lastABCIResponseKey

This is not possible IMHO. I.e. if we know we crashed at height 5, then we'll try to restore last responses for this height.

@ancazamfir

This comment was marked as resolved.

@ancazamfir

This comment was marked as resolved.

@github-actions github-actions Bot removed the stale For use by stalebot label Jan 27, 2024
@melekes
melekes force-pushed the anton/1976-deduplicate-save-abciresponses branch from 423e376 to 17cba18 Compare January 29, 2024 16:00
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale For use by stalebot label Feb 10, 2024
@github-actions github-actions Bot removed the stale For use by stalebot label Feb 13, 2024
@ValarDragon

Copy link
Copy Markdown
Contributor

Anything needed to progress this? Really excited about halving this I/O write time, to improve latency under heavy event load!

@melekes

melekes commented Feb 21, 2024

Copy link
Copy Markdown
Collaborator Author

Nothing is blocking this afaik. The follow-up to this PR should be calling compaction (similar to #1972) because it deletes the previous ABCI response with each new height. See #1972 (comment)

@melekes
melekes enabled auto-merge February 21, 2024 17:45
@melekes
melekes added this pull request to the merge queue Feb 21, 2024
Merged via the queue into main with commit f2c7466 Feb 21, 2024
@melekes
melekes deleted the anton/1976-deduplicate-save-abciresponses branch February 21, 2024 17:59
mergify Bot pushed a commit that referenced this pull request Feb 21, 2024
for performance reasons.
Closes #1976

---

#### PR checklist

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

(cherry picked from commit f2c7466)

# Conflicts:
#	internal/state/store.go
mergify Bot pushed a commit that referenced this pull request Feb 21, 2024
for performance reasons.
Closes #1976

---

#### PR checklist

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

(cherry picked from commit f2c7466)

# Conflicts:
#	state/store.go
#	state/store_test.go
greg-szabo pushed a commit that referenced this pull request Feb 22, 2024
for performance reasons.
Closes #1976

---

#### PR checklist

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

melekes commented Feb 22, 2024

Copy link
Copy Markdown
Collaborator Author

@mergify backport v1.x

@mergify

mergify Bot commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

backport v1.x

✅ Backports have been created

Details

@melekes

melekes commented Feb 22, 2024

Copy link
Copy Markdown
Collaborator Author

@mergify backport v1.x --force

@mergify

mergify Bot commented Feb 22, 2024

Copy link
Copy Markdown
Contributor

backport v1.x --force

❌ No backport have been created

Details

GitHub error: Branch not found

melekes added a commit that referenced this pull request Feb 22, 2024
for performance reasons.
Closes #1976

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
melekes added a commit that referenced this pull request Feb 26, 2024
lasarojc referenced this pull request Mar 12, 2024
- **Versioned protobuf files (#495)**
- **Restore rpc/grpc/v1/types.pb.go**
- **proto: restore deprecation notice on BroadcastAPI**
- **Struct `Client` exposes sensitive data (#784)**
- **Unsafe int cast in `kill` command (#783)**
- **ADR-100: Data Companion Push API (#73)**
- **rfc: incoming txs while catching up (#735)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.17.0 to 1.18.0
(#804)**
- **build(deps): Bump github.com/cosmos/gogoproto from 1.4.8 to 1.4.9
(#806)**
- **build(deps): Bump golang.org/x/sync from 0.1.0 to 0.2.0 (#807)**
- **build(deps): Bump google.golang.org/grpc from 1.54.0 to 1.55.0
(#813)**
- **build(deps): Bump github.com/prometheus/client_golang from 1.15.0 to
1.15.1 (#810)**
- **build(deps): Bump github.com/bufbuild/buf from 1.17.0 to 1.18.0
(#809)**
- **build(deps): Bump github.com/bufbuild/buf from 1.17.0 to 1.18.0
(#809)**
- **build(deps): Bump github.com/prometheus/client_model from 0.3.0 to
0.4.0 (#812)**
- **build(deps): Bump github.com/prometheus/common from 0.42.0 to 0.43.0
(#811)**
- **ADR-103: Protobuf definition versioning (#772)**
- **spec/p2p: Specify the operation of a Reactor (#714)**
- **build(deps): Bump github.com/docker/distribution (#827)**
- **build(deps): Bump github.com/cloudflare/circl from 1.3.1 to 1.3.3
(#828)**
- **ADR-103: Protobuf definition versioning (#772) (#817)**
- **build(deps): Bump github.com/cosmos/gogoproto from 1.4.9 to 1.4.10
(#830)**
- **build(deps): Bump golang.org/x/net from 0.9.0 to 0.10.0 (#831)**
- **build(deps): Bump golang.org/x/crypto from 0.8.0 to 0.9.0 (#832)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.26.1 to 2.27.1
(#833)**
- **rpc: Remove response data from response failure logs (#829)**
- **pubsub/kvindexer:support for big numbers - v2 (#797)**
- **Extend the infrastructure provider with `StartNodes` and
`StopTestnet` (#796)**
- **grpc: Add base gRPC server with version service (#818)**
- **Digital Ocean implementation of `StartNodes` and `StopTestnet`
(#846)**
- **RFC 102: Improve forward compatibility of proto-generated Rust
(#724)**
- **mempool: Add metric to measure how many times a tx was received
(#637)**
- **`e2e` provider is extended with `Disconnect`, `Reconnect` and
`CheckUpgraded` (#852)**
- **Sort `loadtime` tool's report (#854)**
- **feat: make handshake cancelable (#857)**
- **proto: Restore snake_case JSON for `ExecTxResult` (#856)**
- **qa: 200-nodes test on v0.38 (#877)**
- **qa: rotating node test on `v0.38.x` (#883)**
- **Changes to QA related files (e.g., `method.md`) (#878)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.18.0 to 1.19.0
(#868)**
- **build(deps): Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
(#873)**
- **build(deps): Bump github.com/bufbuild/buf from 1.18.0 to 1.19.0
(#872)**
- **Adds `vote_extension_size` to manifests (#858)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.27.1 to 2.28.1
(#893)**
- **build(deps): Bump github.com/prometheus/common from 0.43.0 to 0.44.0
(#892)**
- **build(deps): Bump slackapi/slack-github-action from 1.23.0 to 1.24.0
(#869)**
- **ADR 104: State sync from local application snapshot (#801)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.6.1 to 5.7.0
(#891)**
- **mempool: slight refactor for improving readability (#894)**
- **Add Vote Extension varying size testnet (#888)**
- **fix: lint fail when golangci-lint bump from v1.52.2 to v1.53.x
(#908)**
- **build(deps): Bump github.com/bufbuild/buf from 1.19.0 to 1.20.0
(#912)**
- **build(deps): Bump github.com/golangci/golangci-lint (#917)**
- **build(deps): Bump github.com/spf13/viper from 1.15.0 to 1.16.0
(#913)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.19.0 to 1.20.0
(#910)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.28.1 to 2.28.2
(#914)**
- **Minor fixes to `RELEASES.md` (#923)**
- **Prevent a transaction to appear twice in the mempool (#890)**
- **New metrics to track duplicate votes and block parts (#896) (#905)**
- **e2e tests are being skipped; `INFRASTRUCTURE-*` bug; portGen
inconsistency bug (#933)**
- **build(deps): Bump github.com/bufbuild/buf from 1.20.0 to 1.21.0
(#948)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.20.0 to 1.21.0
(#946)**
- **spec/p2p: document the p2p API used by Reactors (#851)**
- **build(deps): Bump docker/login-action from 2.1.0 to 2.2.0 (#944)**
- **e2e: Generate prometheus.yaml on setup (#954)**
- **Update the type annotations in the light client spec (#955)**
- **build(deps): Bump docker/build-push-action from 4.0.0 to 4.1.0
(#947)**
- **build(deps): Bump docker/setup-buildx-action from 2.5.0 to 2.7.0
(#962)**
- **Add requirement for `CheckTx` in ABCI spec (#928)**
- **fix: avoid recursive call after rename to (*PeerState).MarshalJSON
(#865)**
- **Port upstream proto changes to cometbft package**
- **changelog: Import entries for v0.34.28, v0.34.29, v0.37.1 and
v0.37.2 to `main` (#974)**
- **test/e2e: Fix Docker image build (#984)**
- **build(deps): Bump github.com/BurntSushi/toml from 1.3.0 to 1.3.2
(#952)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.28.2 to 2.29.0
(#953)**
- **Remove duplicate function `deterministicExecTxResult` (#986)**
- **mempool: Fix the benchmarks (#934)**
- **Add `CMT_HOME` (or remove it?) (#983)**
- **Remove buf.yaml at the root of the source tree (#979)**
- **build(deps): Bump docker/build-push-action from 4.1.0 to 4.1.1
(#989)**
- **build(deps): Bump golang.org/x/net from 0.10.0 to 0.11.0 (#994)**
- **build(deps): Bump golang.org/x/sync from 0.2.0 to 0.3.0 (#990)**
- **build(deps): Bump google.golang.org/grpc from 1.55.0 to 1.56.0
(#992)**
- **build(deps): Bump github.com/golangci/golangci-lint from 1.53.2 to
1.53.3 (#996)**
- **build(deps): Bump github.com/prometheus/client_golang from 1.15.1 to
1.16.0 (#991)**
- **spec/p2p: new structure for the p2p specification (#966)**
- **consensus: optimize vote and block part gossip with
HasProposalBlockPartMessage and random sleeps (#904)**
- **Extend ABCI `max_block_size` parameter to give extended control to
the app (#1003)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.21.0 to 1.22.0
(#1026)**
- **Bump logs on non-fatal vote validation failures to Info level
(#1022)**
- **Update codeowners to include DevRel team (#1023)**
- **deps: Manually bump github.com/vektra/mockery/v2 from 2.29.0 to
2.30.1 (#1009)**
- **Update releasing.md to sign tags (#1034)**
- **build(deps): Bump github.com/bufbuild/buf from 1.21.0 to 1.22.0
(#1027)**
- **Rename ABCI enums and values to satisfy buf guidelines (#975)**
- **build(deps): Bump google.golang.org/grpc from 1.56.0 to 1.56.1
(#1028)**
- **docs: Added double quotes to /abci_query path param (#1015)**
- **Update Docs with Finalize Block (#760)**
- **Clarifies that processProposal may be called for set of transactions
different from the one returned in the preceding prepareProposal
(#1033)**
- **Update the annotation of part_set.go (#1056)**
- **build(deps): Bump docker/setup-buildx-action from 2.7.0 to 2.8.0
(#1071)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.30.1 to
2.30.16 (#1064)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.22.0 to 1.23.1
(#1072)**
- **build(deps): Bump github.com/bufbuild/buf from 1.22.0 to 1.23.1
(#1066)**
- **build(deps): Bump google.golang.org/protobuf from 1.30.0 to 1.31.0
(#1065)**
- **build(deps): Bump google.golang.org/grpc from 1.56.1 to 1.56.2
(#1101)**
- **build(deps): Bump golang.org/x/crypto from 0.10.0 to 0.11.0
(#1103)**
- **build(deps): Bump docker/setup-buildx-action from 2.8.0 to 2.9.0
(#1105)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.30.16 to
2.31.1 (#1100)**
- **build(deps): Bump golang.org/x/net from 0.11.0 to 0.12.0 (#1102)**
- **ci: Trigger workflows on merge group (#1118)**
- **Revert "config: add bootstrap peers (#9680)" (#1109)**
- **node: Revert removal of public reactor accessors (#1120)**
- **ci: Disable CodeQL check in merge queues (#1123)**
- **p2p: Remove UPnP functionality (#1114)**
- **ADR 107: Rename proto versions to pre-v1 betas (#1110)**
- **RFC 104: Internal messaging using the actor model (#1092)**
- **build(deps): Bump github.com/bufbuild/buf from 1.23.1 to 1.24.0
(#1131)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.31.1 to 2.32.0
(#1132)**
- **build(deps): Bump docker/setup-buildx-action from 2.9.0 to 2.9.1
(#1133)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.23.1 to 1.24.0
(#1134)**
- **spec: Add mempool specification in English and Quint (#997)**
- **mempool: ADR for refactoring list of senders  (#1032)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.24.0 to 1.25.0
(#1157)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.7.0 to 5.8.0
(#1159)**
- **build(deps): Bump github.com/bufbuild/buf from 1.24.0 to 1.25.0
(#1160)**
- **proxy: Rename "unsynchronized" to "connection-synchronized" local
client creator (#1145)**
- **mempool: Keep track of senders in reactor instead of implementation
(#1010)**
- **cmd: Remove `replay` and `replay-console` subcommands (#1170)**
- **build(deps): Bump google.golang.org/grpc from 1.56.2 to 1.57.0
(#1181)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.8.0 to 5.8.1
(#1180)**
- **ci: Remove Mergify automerge (#1182)**
- **Add gRPC block service (#1142)**
- **blocksync: export errors (#1186)**
- **Porting changes related to creating a lean docker image from
`pierre/fast-prototyping-1059` branch. (#1192)**
- **chore: Format repo (#1193)**
- **Add BlockResults gRPC service (#1168)**
- **consensus: remove logic to unlock block on +2/3 prevote for nil
(#1175)**
- **ADR 101: Add GetLatest method to block service (#1209)**
- **ADR 101: Implement pruning mechanism (#1150)**
- **config: export errors (#1190)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.32.0 to 2.32.3
(#1218)**
- **Add check for non-`nil` in `enterCommit` (#1208)**
- **Log proposer's address when correctly accepting a proposal (#1079)**
- **Close evidence.db OnStop (#1210)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.25.0 to 1.25.1
(#1213)**
- **build(deps): Bump golang.org/x/crypto from 0.11.0 to 0.12.0
(#1215)**
- **build(deps): Bump github.com/bufbuild/buf from 1.25.0 to 1.25.1
(#1216)**
- **build(deps): Bump golang.org/x/net from 0.12.0 to 0.14.0 (#1217)**
- **Forward-port: update state to prevote `nil` when proposal block does
not match locked block (#1203)**
- **mempool: Store peer ids as p2p.ID instead of uint16 (remove
mempoolIDs) (#1191)**
- **ADR-101: implement gRPC `PruningService` (#1154)**
- **consensus: Avoid process proposal when we know correct nodes
validated it (#1231)**
- **ADR-101: Metrics to monitor the pruning  (#1234)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.25.1 to 1.26.0
(#1241)**
- **build(deps): Bump github.com/bufbuild/buf from 1.25.1 to 1.26.1
(#1239)**
- **build(deps): Bump github.com/golangci/golangci-lint (#1240)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.32.3 to 2.32.4
(#1242)**
- **abci: export errors  (#1185)**
- **consensus: export errors (#1211)**
- **ADR-101: Pruning mechanism minor fixes (#1246)**
- **chore: Bump minimum Go version on `main` to v1.21 (#1244)**
- **ADR 101: Add `Close` method to gRPC client (#1251)**
- **ADR 108: ADR for extending E2E infrastructure so that we can check
CometBFT's behaviour with respect to ABCI++ grammar. (#902)**
- **docs: Add logging guide to contributing guidelines (#1250)**
- **chore: log `app_hash` as hex (#1264)**
- **update language (#1263)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.26.0 to 1.26.1
(#1272)**
- **build(deps): Bump gonum.org/v1/gonum from 0.13.0 to 0.14.0 (#1275)**
- **build(deps): Bump github.com/cosmos/gogoproto from 1.4.10 to 1.4.11
(#1276)**
- **ADR 101: Refactor height check-related logic and tests (#1271)**
- **Fixed linter**
- **Revert "Fixed linter"**
- **Fixed mem aliasing in for loop (#1280)**
- **Remove genesis persistence in state db (#1017)**
- **Revert "Remove genesis persistence in state db (#1017)" (#1294)**
- **evidence: export errors (#1284)**
- **Re-implement removal of genesis persistence in state db (#1295)**
- **build(deps): Bump docker/setup-buildx-action from 2.9.1 to 2.10.0
(#1298)**
- **node: verify genesis doc hash against the file contents rather than
remarshalled JSON (#1293)**
- **indexer: Implement pruning mechanism (#1176)**
- **Provide relevant block data in `ExtendVote` (#1270)**
- **node/state:bootstrap state api (#1057)**
- **build(deps): Bump actions/checkout from 3 to 4 (#1319)**
- **build(deps): Bump docker/build-push-action from 4.1.1 to 4.2.1
(#1318)**
- **Fix (#1323)**
- **state: remove genesis file from database  (#1297)**
- **Added changelog for pruning metrics (#1335)**
- **Removed begin_block_events and end_block_events from rpc doc
(#1338)**
- **consensus: test for precommit/locking corner case (#1257)**
- **TxIndexer and BlockIndexer pruning metrics (#1334)**
- **Forward port changes to changelog and `UPGRADING.md` for release
`v0.38.0` (#1341)**
- **Update Go version specified in root README on main for v0.34.x
(#1352)**
- **Add test/e2e/data to gitignore (#1349)**
- **docs: gRPC services and data companion pruning services (#1307)**
- **Add genesis_hash flag check on node startup (#1324)**
- **gRPC for Tx and Block indexer pruning (#1327)**
- **build(deps): Bump docker/build-push-action from 4.2.1 to 5.0.0
(#1371)**
- **build(deps): Bump docker/setup-buildx-action from 2.10.0 to 3.0.0
(#1370)**
- **build(deps): Bump docker/login-action from 2.2.0 to 3.0.0 (#1368)**
- **build(deps): Bump goreleaser/goreleaser-action from 4 to 5 (#1369)**
- **ADR101: Moved changelog entries (#1377)**
- **Max byte check (#1384)**
- **Update to string (#1385)**
- **mempool: Remove unused peerID constants (#1379)**
- **build(deps): Bump github.com/google/uuid from 1.3.0 to 1.3.1
(#1392)**
- **build(deps): Bump github.com/rs/cors from 1.9.0 to 1.10.0 (#1393)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.8.1 to 5.9.0
(#1396)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.32.4 to 2.34.0
(#1400)**
- **build(deps): Bump github.com/go-kit/kit from 0.12.0 to 0.13.0
(#1397)**
- **build(deps): Bump github.com/golangci/golangci-lint (#1398)**
- **build(deps): Bump google.golang.org/grpc from 1.57.0 to 1.58.2
(#1399)**
- **doc: improve documentation of BlockParams.MaxBytes (#1405)**
- **rpc: Improve abci_query parameter documentation (#1184)**
- **Bump p2p version following introduction of
`HasProposalBlockPartMessage` (#1411)**
- **RFC: Allowing Non-Determinism in `ProcessProposal` (#1391)**
- **ADR-101: Data Companion Pull API (#82)**
- **build(deps): Bump github.com/rs/cors from 1.10.0 to 1.10.1 (#1418)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.34.0 to 2.34.2
(#1416)**
- **build(deps): Bump github.com/prometheus/client_golang (#1417)**
- **fix typos (#1413)**
- **Renames Tendermint to CometBFT in the RPC related test code
(#1428)**
- **Renames Tendermint to CometBFT in the RPC related test code. This
file was missing and it was not caught in the branch testing. (#1433)**
- **Reject incoming txs while node is catching up (#1119)**
- **build(deps): Bump golang.org/x/crypto from 0.13.0 to 0.14.0
(#1458)**
- **build(deps): Bump golang.org/x/sync from 0.3.0 to 0.4.0 (#1454)**
- **build(deps): Bump golang.org/x/net from 0.15.0 to 0.16.0 (#1453)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.26.1 to 1.27.0
(#1449)**
- **build(deps): Bump styfle/cancel-workflow-action from 0.11.0 to
0.12.0 (#1450)**
- **build(deps): Bump github.com/prometheus/client_model (#1455)**
- **build(deps): Bump github.com/bufbuild/buf from 1.26.1 to 1.27.0
(#1459)**
- **build(deps): Bump github.com/spf13/viper from 1.16.0 to 1.17.0
(#1456)**
- **test: respect P2PConfig fuzzing configuration in MultiplexTransport
(#1414)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.34.2 to 2.35.3
(#1462)**
- **crypto: export errors (#1463)**
- **Do not race with pruning to validate headers and validators
(#1467)**
- **fix typos (#1487)**
- **Call observer only when retain height changes (#1490)**
- **build(deps): Bump pillow from 9.3.0 to 10.0.1 in
/scripts/qa/reporting (#1493)**
- **abci: Add relaxed local client synchronization models (#1141)**
- **docs: fix typos (#1500)**
- **Post-merge fixes for feature/proto-upgrade**
- **Make BuildLastCommitInfo and BuildExtendedCommitInfo public
(#1502)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.35.3 to 2.35.4
(#1497)**
- **build(deps): Bump google.golang.org/grpc from 1.58.2 to 1.58.3
(#1498)**
- **build(deps): Bump golang.org/x/net from 0.16.0 to 0.17.0 (#1499)**
- **tiny change: reorder expected and actual values (#1506)**
- **Fixed docker port alias (#1507)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.27.0 to 1.27.1
(#1527)**
- **Implement ADR-107: rename proto package version suffixes to v1beta*
pattern (#1510)**
- **e2e: Fix flakiness in grpc tests due to pruning (#1492)**
- **fix spelling of bandwidth (#1534)**
- **Fix linting on `main` (#1531)**
- **build(deps): Bump github.com/prometheus/common from 0.44.0 to 0.45.0
(#1524)**
- **build(deps): Bump github.com/bufbuild/buf from 1.27.0 to 1.27.1
(#1522)**
- **build(deps): Bump github.com/golangci/golangci-lint (#1540)**
- **fix some typos (#1541)**
- **indexer-respect-height-params-on-query (#1529)**
- **Correct go_package paths in service proto files (#1538)**
- **build(deps): Bump google.golang.org/grpc from 1.58.3 to 1.59.0
(#1521)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.35.4 to 2.36.0
(#1523)**
- **feat(mempool): export error (#1427)**
- **Rename proto messages and services to satisfy default buf lints
(#1533)**
- **RFC 106: non-idempotent methods in data companion (#1545)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.9.0 to 5.10.0
(#1550)**
- **build(deps): Bump github.com/bufbuild/buf from 1.27.1 to 1.27.2
(#1551)**
- **build(deps): Bump github.com/google/uuid from 1.3.1 to 1.4.0
(#1552)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.27.1 to 1.27.2
(#1553)**
- **use assert.Greater instead of Equal for better error reporting
(#1547)**
- **rpc: Version the RPC APIs (#1412)**
- **mempool: Add metric size of pool in bytes (#1512)**
- **build(deps): Bump github.com/docker/docker (#1570)**
- **build(deps): Bump github.com/spf13/cobra from 1.7.0 to 1.8.0
(#1572)**
- **build(deps): Bump golang.org/x/sync from 0.4.0 to 0.5.0 (#1574)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.36.0 to 2.36.1
(#1576)**
- **build(deps): Bump github.com/gorilla/websocket from 1.5.0 to 1.5.1
(#1575)**
- **build(deps): Bump github.com/golangci/golangci-lint (#1573)**
- **chore: consolidate changelog improvements section (#1578)**
- **Implementation of ADR-108 (#930)**
- **Reduce the default MaxBytes to 4mb and increase MaxGas to 10 million
(#1518)**
- **e2e: Allow disabling the PEX reactor on all nodes in the testnet
(#1580)**
- **Experimental - Reduce # of connections effectively used to gossip
transactions out (#1558)**
- **Update proto file references to follow renaming/versioning (#1555)**
- **Make `LoadBlock` also return block metadata (#1557)**
- **mempool: Limit gossip connections to persistent and non-persistent
peers (experimental) (#1584)**
- **fix: docs: default db provider moved from node to config (#1588)**
- **build(deps): Bump github.com/bufbuild/buf from 1.27.2 to 1.28.0
(#1598)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.27.2 to 1.28.0
(#1602)**
- **build(deps): Bump golang.org/x/crypto from 0.14.0 to 0.15.0
(#1599)**
- **build(deps): Bump golang.org/x/net from 0.17.0 to 0.18.0 (#1597)**
- **RFC 107: Internal signalling using event observers (#1164)**
- **ADR 110: Remote mempool (#1565)**
- **chore: aligns function descriptions with godoc standards in the
types package (#1593)**
- **docs: various improvements (#1603)**
- **chore: Merge branch main into feature/proto-upgrade (#1612)**
- **Removes wrong assertion and decreases likelyhood of block from the
future has actually been already created (#1619)**
- **Split /api off to separate go.mod (#1608)**
- **feature: Reduce Go API surface area (ADR 109) (#1605)**
- **refactor: Export func MakeHTTPDialer (#1594)**
- **First draft (#1483)**
- **pruning:do not attempt to prune state if no blocks are pruned
(#1616)**
- **Update SECURITY.md (#1626)**
- **Update changelog on `main` with new releases (#1644)**
- **proto: Update README (#1648)**
- **ADR 111: `nop` Mempool (#1585)**
- **ADR-111: Addressed Ethan's comment (#1667)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.36.1 to 2.37.1
(#1662)**
- **build(deps): Bump docker/build-push-action from 5.0.0 to 5.1.0
(#1664)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.28.0 to 1.28.1
(#1665)**
- **ci: Fix v0.34 nightly build (#1655)**
- **build(deps): Bump github.com/bufbuild/buf from 1.28.0 to 1.28.1
(#1663)**
- **feature/proto-upgrade: Fix generated mock code (#1673)**
- **Update link in README.md (#1674)**
- **Renames the semantic versioning variable to CMT (#1621)**
- **mempool: add `nop` mempool (#1643)**
- **e2e:fix-digital-ocean-ports (#1678)**
- **Revert modularization of the test infra (#1488) (#1676)**
- **docs: various small improvements (part 2) (#1683)**
- **Do not block indefinitely on the semaphore (#1654)**
- **Adds tests that check for FIFO ordering being broken by gossip
(#1628)**
- **loadtime: Add parameter for displaying results in one line (#1511)**
- **Promote latest versions of Protobuf definitions to v1 packages
(#1677)**
- **chore: Update CHANGELOG.md (#1701)**
- **build(deps): Bump github.com/google/uuid from 1.3.1 to 1.4.0
(#1696)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.37.1 to 2.38.0
(#1697)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.9.0 to 5.10.1
(#1702)**
- **proto: document the `cometbft.*` versioned protos (#1694)**
- **Clean up changelog entries and README files for versioned proto
changes (#1707)**
- **chore(proto): add missing docs (#1703)**
- **feature/proto-upgrade: Last-minute fixes (#1709)**
- **e2e: Support emulated latencies between docker images (#1560)**
- **build(deps): Bump golang.org/x/net from 0.14.0 to 0.17.0 in /api
(#1713)**
- **Prepare `main` for `v1.x` backport branch (#1714)**
- **build(deps): Bump golang.org/x/crypto from 0.15.0 to 0.16.0
(#1720)**
- **build(deps): Bump golang.org/x/net from 0.18.0 to 0.19.0 (#1719)**
- **types: validate Validator#Address field (#1715)**
- **Enable Mergify backports for `v1.x` branch (#1724)**
- **deps: Bump cometbft-db to v0.9.0 (#1725)**
- **buf improvements prior to publishing on BSR (#1726)**
- **proto: give our buf module a name (#1734)**
- **deps: Bump cometbft-db to v0.9.1 (#1737)**
- **chore: Update root docs (#1740)**
- **fix: increase abci socket message size limit to 2GB (#1730)**
- **proto: make comment in README more Markdowny (#1743)**
- **fix: Txs Validate (#1687)**
- **Add test missing in #1687 (#1712)**
- **perf(state): batch save `State` (#1735)**
- **Update CODE_OF_CONDUCT.md (#1708)**
- **[e2e] Fixes prepareProposal not to return oversized set of
transactions (#1756)**
- **perf(store): Batch save `Block` (#1755)**
- **Fix: Fix minor typos (#1780)**
- **`VerifyCommitLight` and `VerifyCommitLightTrusting` _never_ check
all signatures (#1750)**
- **Fix typo in encoding.md (#1801)**
- **chore(docs): small improvements (#1781)**
- **build(deps): Bump github.com/go-git/go-git/v5 from 5.10.1 to 5.11.0
(#1797)**
- **build(deps): Bump actions/setup-go from 4 to 5 (#1794)**
- **build(deps): Bump actions/stale from 8 to 9 (#1795)**
- **build(deps): Bump github.com/spf13/viper from 1.17.0 to 1.18.1
(#1796)**
- **Chore/fix other typos (#1809)**
- **chore(spec): specify which fields must be deterministic (#1804)**
- **Small improvements in #1806 not present in #1750 (#1808)**
- **Add changelog for #1749 (#1807)**
- **e2e: Implement latency emulation for DigitalOcean (#1587)**
- **add GH workflow for linting code using codespell (#1824)**
- **chore(docs): explain the effect of `timeout_propose` (#1798)**
- **build(deps): Bump actions/upload-artifact from 3 to 4 (#1845)**
- **build(deps): Bump actions/setup-python from 2 to 5 (#1843)**
- **build(deps): Bump github/codeql-action from 2 to 3 (#1847)**
- **build(deps): Bump actions/checkout from 2 to 4 (#1846)**
- **build(deps): Bump github.com/google/uuid from 1.4.0 to 1.5.0
(#1850)**
- **build(deps): Bump google.golang.org/grpc from 1.59.0 to 1.60.0
(#1851)**
- **golangci-lint: enable all the linters by default (#1838)**
- **Updates go crypto package to v0.17.0 (#1859)**
- **Adds checks for nil keys and signatures (#1855)**
- **The store DB and the companion `BlockStore` struct are sometimes out
of sync (#1856)**
- **Allow blocksync to not verify all signatures (#1858)**
- **Fixing the ABCI grammar and updating the code for e2e tests to
account for the new grammar. (#1829)**
- **docs: Fix Discord links in README (#1874)**
- **build(deps): Bump github.com/prometheus/client_golang (#1909)**
- **build(deps): Bump github.com/btcsuite/btcd/btcutil from 1.1.3 to
1.1.5 (#1908)**
- **build(deps): Bump google.golang.org/protobuf (#1885)**
- **build(deps): Bump github.com/spf13/viper from 1.18.1 to 1.18.2
(#1884)**
- **build(deps): Bump google.golang.org/grpc from 1.60.0 to 1.60.1
(#1883)**
- **remove unused linters that produced a warning and ensure that
unparam is enabled (#1905)**
- **Fix HTTP response body not being closed after reading (#1945)**
- **Disable undesired linting code (#1959)**
- **Extend kvstore example add with with key types (#1876)**
- **Extra check in `VerifyExtension` (#1877)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.38.0 to 2.39.1
(#1882)**
- **perf(crypto/merkle, crypto/tmhash): simplify+optimize SHA256 hashing
of multiple byteslices (#1921)**
- **Update localnet-start Makefile (#1975)**
- **blocksync: wait for poolRoutine to stop in (*Reactor).OnStop
(#1879)**
- **fix TestListenerTimeoutReadWrite (#1947)**
- **docs: fix typos (#1988)**
- **this is the kindest commit I can think of. Take it that way and read
the code. (#1987)**
- **there's really no need for this anymore (#1986)**
- **feat: DefaultHttpClient support setting proxy from env (#1900)**
- **feat: lint tests (#1906)**
- **chore: fix typos (#1991)**
- **build(deps): Bump golang.org/x/sync from 0.5.0 to 0.6.0 (#1992)**
- **feat(proxy): export errors (#1899)**
- **doc:fix broken link in DOCKER/README.md (#1996)**
- **feat: custom dependencies order (#1994)**
- **PBTS: migrating to `main` the new version of the specification
(#1973)**
- **Fix paths to scripts/metricsgen in go:generate commands (#1998)**
- **chore: fix some typos (#2002)**
- **docs(light): fix broken link to spec (#2007)**
- **chore(test/loadtime): replace tm-load-test w/ cometbft-load-test
(#2009)**
- **ci: Remove unused `tests` target when compiling e2e (#2022)**
- **spec: fix typo in `encoding.md` (#2024)**
- **mempool: Fix data races in CListMempool's height and
notifiedTxsAvailable (#2021)**
- **chore(test/loadtime): cleanup go.sum and golangci.yml (#2025)**
- **build(deps): Bump github.com/prometheus/common from 0.45.0 to 0.46.0
(#2040)**
- **build(deps): Bump github.com/vektra/mockery/v2 from 2.39.1 to 2.40.1
(#2038)**
- **feat(rpc): Use default port for HTTP(S) URLs when there is no
explicit port (#1903)**
- **misc(go.mod): remove unused peg dependency (#2044)**
- **config: Remove unused `max_batch_bytes` (#2050)**
- **Merge pull request from GHSA-qr8r-m495-7hc4**
- **misc(tools)!: remove `tools` package (#2046)**
- **docs(guides): add missing import (#2070)**
- **deps(localnode): bump alpine version (#2077)**
- **misc(Makefile): add `help` target to display the help msg (#2074)**
- **`e2e`: test vote extension activation via `InitChain` and
`FinalizeBlock` (#2066)**
- **scripts: metricsgen parses '// metrics:' pattern (#2090)**
- **e2e: Add `load_max_txs` option to manifest (#2094)**
- **consensus: Add `chain_size_bytes` metric (#2093)**
- **feat: conventional commits (#1995)**
- **Forward port of tendermint/tendermint#7605, tendermint/spec#393, and
tendermint/tendermint#8142 (#2018)**
- **ci: fix permissions for "Conventional PR Title" (#2099)**
- **PBTS: additions and fixes on migrated spec (#2013)**
- **PBTS: forward port of tendermint/tendermint#7709 (#2089)**
- **feat: use go workspace (#1924)**
- **fix: `ValidateUpdate`: allow no-change updates regardless of current
height (#2112)**
- **test(localnet): Add monitoring tools for localnet (#2108)**
- **feat: add gofumpt (#2049)**
- **feat(consensus): increase log level for corner case when prevoting a
proposal (#2042)**
- **docs: v1 - diataxis framework (#2105)**
- **feat(consensus): additional sanity checks for the size of proposed
blocks (#1408)**
- **perf(internal/blocksync): avoid double-calling
`types.BlockFromProto` (#2016)**
- **build(deps): Bump google.golang.org/grpc from 1.60.1 to 1.61.0
(#2178)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.28.1 to 1.29.0
(#2161)**
- **build(deps): Bump styfle/cancel-workflow-action from 0.12.0 to
0.12.1 (#2160)**
- **build(deps): Bump slackapi/slack-github-action from 1.24.0 to 1.25.0
(#2162)**
- **build(deps): Bump github.com/google/uuid from 1.5.0 to 1.6.0
(#2176)**
- **refactor(privval): reverse conditional + more idiomatic Go code with
early returns (#2156)**
- **fix(e2e): path to latency script files in DO (#2148)**
- **build(deps): Bump github.com/cometbft/cometbft-db from 0.9.1 to
0.10.0 (#2175)**
- **chore(Makefile): add `setup-pre-commit` target to init git hook
(#2123)**
- **feat: add pebbledb (https://github.com/cockroachdb/pebble) (#2132)**
- **perf(internal/blocksync): do not `ValidateBlock` twice (#2026)**
- **feat(e2e): Add new targets `fast` and `clean` to Makefile (#2192)**
- **ci: add `spec` type in conventional-pr-title (#2191)**
- **fix(privval): retry accepting a connection on errors (#2047)**
- **fix(.github/workflows): correct parameters to lint_pr_title
(#2199)**
- **docs: update QA method steps for qa-infra changes (#2198)**
- **feat!(pbts): forward port of tendermint/tendermint#7711 (#2149)**
- **docs(pbts): forward port of PBTS documentation and fixes (#2124)**
- **fix: if-return and early-return (#2215)**
- **chore: remove amazon linux Dockerfile and update
test/docker/Dockerfile (#2135)**
- **feat(ci): pre-commit framework (#2214)**
- **ci: add `merge` type for conventional-pr-title (#2219)**
- **spec(consensus/pbts): update description for introduced parameters.
(#2206)**
- **perf: optimize psql indexer (#2142)**
- **fix(go.mod): do not use `replace` for api (#2236)**
- **fix(Makefile): gofumpt no longer needed (#2235)**
- **fix(p2p/pex): gracefully shutdown `Reactor` (#2010)**
- **test(mempool): fix
TestMempoolUpdateDoesNotPanicWhenApplicationMissedTx (#2242)**
- **fix(flowrate): fix non-determinism in flowrate tests (#2147)**
- **refactor!: Implement RFC 106: remove `GetLatestBlock*` methods from
data companion API (#2240)**
- **build(deps): Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7
(#2253)**
- **chore(config): update DB section in toml.go (#2249)**
- **fix(consensus): do not precommit nil if proposal block is received
(#2221)**
- **build(deps): Bump github.com/opencontainers/runc from 1.1.5 to
1.1.12 (#2261)**
- **fix(mempool/tests): Reduce tests duration (#2263)**
- **ci: run golangci-lint linters for all files (not only ones which
were modified) (#2250)**
- **refactor(examples): small changes to kvstore app (#2267)**
- **refactor(mempool): simplify parameters of resCbFirstTime and
resCbRecheck (#2272)**
- **perf(mempool/cache): clear map in Reset (#2259)**
- **test(abci): update e2e tests to check against ABCI 2.0 grammar
(#2201)**
- **docs: symbolic references to steps in the qa-infra README (#2280)**
- **chore: updated doc link (#2296)**
- **fix(consensus): prevote nil upon timeout when Proposal is missing
(#2218)**
- **build(deps): Bump pre-commit/action from 3.0.0 to 3.0.1 (#2307)**
- **build(deps): Bump golang.org/x/net from 0.20.0 to 0.21.0 (#2300)**
- **build(deps): Bump github.com/cometbft/cometbft-db from 0.10.0 to
0.11.0 (#2299)**
- **docs: ADR-112 Proposer-Based Timestamps (#2223)**
- **refactor(internal/statesync): replace ticker with `time.After(X)`
(#2294)**
- **fix: simultaneous rpc test failures (#2150)**
- **chore(docs): alter the section about the effects of `timeout_commit`
(#1892)**
- **refactor(p2p)!: Refactor PeerSet to eliminate data races & improve
performance (#2246)**
- **feat(pbts): Update consensus params to include pbts enabled
(#2231)**
- **feat(storage/metrics): Metrics to measure storage (#1974)**
- **feat(e2e): Log number of sent txs (success and failed) (#2328)**
- **chore: enable gomoddirectives, unparam (#2290)**
- **docs: images not rendering properly in docs (#2331)**
- **docs: Fix references about DeliverTx (#2330)**
- **docs(qa): Add table of contents to existing QA reports (#2343)**
- **chore: enable perfsprint linter (#2291)**
- **feat(pruning): trigger explicitly compaction upon pruning (#1972)**
- **docs: explain how to skip pre-commit hook (#2358)**
- **build(deps): Bump github.com/prometheus/common from 0.46.0 to 0.47.0
(#2373)**
- **build(deps): Bump google.golang.org/grpc from 1.61.0 to 1.61.1
(#2372)**
- **feat(e2e): Option to set max block size in bytes at genesis
(#2362)**
- **build(deps): Bump github.com/prometheus/client_model from 0.5.0 to
0.6.0 (#2371)**
- **revert(pbts): revert removal of BFT Time related functions (#2205)**
- **fix(e2e): Reduce flakiness of TestGRPC_GetBlockResults (#2367)**
- **spec(consensus): update Block Time documentation in spec (#2316)**
- **spec: adaptive MSGDELAY parameter included in PBTS spec (#2318)**
- **feat(pbts): Moving VoteExtensionsEnableHeight from ABCIParams to
FeatureParams. (#2335)**
- **fix: remove TestMempoolFIFOWithParallelCheckTx (#2364)**
- **fix(docker-compose): fix subnet (#2383)**
- **feat(pbts): enable `e2e` manifest config to set `PbtsEnableHeight`
(#2284)**
- **perf(internal/state): avoid double-saving FinalizeBlockResponse
(#2017)**
- **build(deps): Bump fonttools from 4.37.4 to 4.43.0 in
/scripts/qa/reporting (#2407)**
- **build(deps): Bump pillow from 10.0.1 to 10.2.0 in
/scripts/qa/reporting (#2408)**
- **fix(node): Forward compaction config params to blockstore
constructor (#2418)**
- **refactor!: moved `MedianTime` out of `internal` folder (#2397)**
- **chore: typo fixes (#2403)**
- **chore(pbts): Removes useless code (#2420)**
- **build(deps): Bump github.com/prometheus/common from 0.47.0 to 0.48.0
(#2430)**
- **build(deps): Bump google.golang.org/grpc from 1.61.1 to 1.62.0
(#2429)**
- **test(consensus): PBTS should be enabled by default in test units
(#2329)**
- **test(consensus): test enabling PBTS at a given height (#2404)**
- **refactor(protobuf): switch from gogofaster to gocosmos generator
(#2425)**
- **docs(tutorials/install): add `From Go package` (#2414)**
- **docs(pbts): documentation for PBTS-related consensus parameters
(#2376)**
- **refactor(consensus): print err from SignAndCheckVote (#2346)**
- **feat(e2e): add parameter to set a custom output directory for
testnet files (#2433)**
- **spec(consensus): update description of consensus parameters for PBTS
(#2415)**
- **fix(localnet): Grafana dashboards for storage tests - removed
experimental metrics (#2448)**
- **fix(jsonrpc): enable HTTP basic auth in WS client (#2434)**
- **feat(pbts): Adds timestamp to the `msgInfo` written into the WAL
(#2388)**
- **fix: `Rollback`: wrong modification of
`state.LastHeightValidatorsChanged` while rollback at a special height
(#2136)**
- **docs(changelog): add missing entry for #2136 (#2459)**
- **fix(pbts): legacy `ABCIParams` values are properly translated to
`FeatureParams` values (#2462)**
- **fix(e2e): Fixing the bug in ABCI e2e tests (#2468)**
- **feat(localnet): Grafana PNG rendering for easier graph exports
(#2472)**
- **docs(README): remove Terra (#2469)**
- **docs: document PBTS adaptive delays mechanism (#2452)**
- **fix(config): Moved compact variables to the right section (#2477)**
- **feat(metrics): more buckets for ProposalTimestampDifference
(#2479)**
- **fix(metrics): more buckets for ProposalTimestampDifference (#2481)**
- **feat(pbts): Make synchrony params adaptive (#2431)**
- **ci: check metrics generation in CI checks (#2483)**
- **feat(consensus): improve logging for timely and untimely messages
(#2321)**
- **feat(types): improve Proposal and SynchronyParams validation tests
(#2489)**
- **test(consensus): refactor TestStateLock_POLSafety tests (#2492)**
- **feat(types): refactor types.AdaptiveSynchronyParams method (#2490)**
- **fix: lint errors introduced with the latest merge (#2495)**
- **build(deps): Bump docker/setup-buildx-action from 3.0.0 to 3.1.0
(#2500)**
- **build(deps): Bump github.com/prometheus/client_golang from 1.18.0 to
1.19.0 (#2508)**
- **build(deps): Bump golang.org/x/crypto from 0.19.0 to 0.20.0
(#2507)**
- **build(deps): Bump github.com/prometheus/common from 0.48.0 to 0.49.0
(#2506)**
- **build(deps): Bump github.com/stretchr/testify from 1.8.4 to 1.9.0
(#2505)**
- **fix(docs): include `timesync` daemon instructions (#2491)**
- **feat(privval)!: DO NOT require extension signature (#2496)**
- **refactor(privval): rename sign_extension to skip_sign_extension
(#2519)**
- **spec(abci): fixes the spec to inform about the presence of invalid
extensions in `last_commit` (#2423)**
- **fix(pbts): block Time must be Canonical (#2493)**
- **feat(e2e): Add manifest option `clock_skew` and corresponding
backend functionality (#2454)**
- **fix(mempool): converting to uint64 before additions to avoid
overflows (#2498)**
- **refactor!: Rename `skip_sign_extension` to `skip_extension_signing`
(#2522)**
- **docs(ADR): ADR-108 updated to account for the new changes in the
grammar and code. (#2528)**
- **feat(e2e): add generator support for clock skew + env variable
rename (#2488)**
- **spec(proto): add `cometbft.privval.v1beta2` proto package (#2529)**
- **chore: improving error handling in the PendingEvidence (#2550)**
- **feat(blocksync)!: set the max number of (concurrently) downloaded
blocks to {peersCount * 20} (#2467)**
- **build(deps): Bump bufbuild/buf-setup-action from 1.29.0 to 1.30.0
(#2557)**
- **build(deps): Bump google.golang.org/protobuf from 1.32.0 to 1.33.0
(#2560)**
- **build(deps): Bump golang.org/x/net from 0.21.0 to 0.22.0 (#2562)**
- **fix(cmd/cometbft/commands/version): update the output for v1
(#2546)**
- **build(deps): Bump docker/build-push-action from 5.1.0 to 5.2.0
(#2558)**
- **build(deps): Bump github.com/prometheus/common from 0.49.0 to 0.50.0
(#2559)**
- **build(deps): Bump google.golang.org/grpc from 1.62.0 to 1.62.1
(#2563)**
- **build(deps): Bump golang.org/x/crypto from 0.20.0 to 0.21.0
(#2561)**
- **feat(blocksync): sort peers by download rate & multiple requests for
closer blocks (#2475)**
- **feat(pbts): Adjusts PBTS metrics buckets (#2578)**
- **fix(blocksync): use timer instead of time.After (#2584)**
- **fix: temporary fix for `api` dependency (#2589)**

---------

Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Thane Thomson <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anton Kaliaev <[email protected]>
Co-authored-by: Mikhail Zabaluev <[email protected]>
Co-authored-by: Troy Kessler <[email protected]>
Co-authored-by: leven <[email protected]>
Co-authored-by: werty144 <[email protected]>
Co-authored-by: Adi Seredinschi <[email protected]>
Co-authored-by: Sukey <[email protected]>
Co-authored-by: Sergio Mena <[email protected]>
Co-authored-by: Jasmina Malicevic <[email protected]>
Co-authored-by: moriluka <[email protected]>
Co-authored-by: Đỗ Việt Hoàng <[email protected]>
Co-authored-by: alex <[email protected]>
Co-authored-by: Hernán Vanzetto <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: Andy Nogueira <[email protected]>
Co-authored-by: nenadmilosevic95 <[email protected]>
Co-authored-by: nenadmilosevic95 <[email protected]>
Co-authored-by: Jacob Gadikian <[email protected]>
Co-authored-by: Greg Szabo <[email protected]>
Co-authored-by: Emmanuel T Odeke <[email protected]>
Co-authored-by: jchappelow <[email protected]>
Co-authored-by: shuoer86 <[email protected]>
Co-authored-by: levisyin <[email protected]>
Co-authored-by: vuittont60 <[email protected]>
Co-authored-by: Halimao <[email protected]>
Co-authored-by: alex <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: Josef Widder <[email protected]>
Co-authored-by: William Banfield <[email protected]>
Co-authored-by: Kukovec <[email protected]>
Co-authored-by: Daniel Cason <cason@gandria>
Co-authored-by: M. J. Fromberger <[email protected]>
Co-authored-by: hattizai <[email protected]>
Co-authored-by: Huulu <[email protected]>
Co-authored-by: katelyn martin <[email protected]>
Co-authored-by: Richard Gibson <[email protected]>
Co-authored-by: Jean Deruelle <[email protected]>
Co-authored-by: glnro <[email protected]>
Co-authored-by: Greg Szabo <[email protected]>
Co-authored-by: Emmanuel T Odeke <[email protected]>
Co-authored-by: levisyin <[email protected]>
Co-authored-by: k0marov <[email protected]>
Co-authored-by: Adi Seredinschi <[email protected]>
Co-authored-by: Pan chao <[email protected]>
Co-authored-by: Khanh Hoa <[email protected]>
Co-authored-by: glnro <[email protected]>
Co-authored-by: toni <[email protected]>
Co-authored-by: DragonKid <[email protected]>
Co-authored-by: Matt Ketmo <[email protected]>
Co-authored-by: Ethan <[email protected]>
Co-authored-by: Evgeny Danilenko <[email protected]>
Co-authored-by: Duong Minh Ngoc <[email protected]>
Co-authored-by: Kero <[email protected]>
gfanton added a commit to gnolang/gno that referenced this pull request Aug 31, 2026
… write fails (#6085)

## Summary

A node killed between the application's commit of height H and
`SaveState(H)` loses the stored ABCIResponses for H. Every subsequent
start then fails the ABCI handshake with:

```
error during handshake: error on replay: Could not find results for height #H
```

The node never recovers on its own. The record exists precisely to cover
this crash window, but it was written without a flush, so it died in the
same crash it was supposed to protect against. This bricked the same
production node twice in two days.

The fix is two small changes in `SaveABCIResponses`:

1. `db.Set` becomes `db.SetSync`, so the record is on disk before the
application commits.
2. Its write error (previously discarded) is returned, so `ApplyBlock`
stops the block *before* the application commit instead of committing a
height whose recovery record was never stored.

Fixes [#6055](#6055).

<details>
<summary>Mapping to #6055's items (two are deliberately scoped
out)</summary>

The missing flush and the dropped `SaveABCIResponses` error are fixed
here, with regression tests. Scoped out:

- `SaveState`'s own dropped error: past the application commit a save
failure has no in-place remedy (the app is already at H), so returning
it buys no recovery. Reasonable follow-up.
- A handshake-level test against an *already*-skewed directory: a skewed
store cannot be repaired at handshake time; that scenario belongs to
recovery tooling (see "Recovery for already-skewed stores").

</details>

## Root cause

`BlockExecutor.ApplyBlock` persists a block in this order
(`tm2/pkg/bft/state/execution.go`):

1. `SaveABCIResponses(db, H, …)`, a plain `db.Set`
2. the tx result index, also plain `db.Set`
3. `proxyApp.CommitSync()`: the application store commit, atomic and
fsynced
4. `SaveState(db, state)`, which ends in `db.SetSync`

On the WAL-based backends `Set` is unsynced (pebbledb, the production
default, passes `pebble.NoSync`), so steps 1 and 2 become durable only
when step 4 flushes the log. A death between 3 and 4 loses the responses
**and** the state while the block store and the application keep H:

```
block store = H, application = H, state = H-1, abciResponses(H) = missing
```

`Handshaker.ReplayBlocks` handles this shape by replaying H against a
mock application that serves the stored responses (the real application
must not re-execute a height it already committed). `LoadABCIResponses`
is its only source and there is no fallback: startup fails
deterministically, forever.

This is a regression, not a design choice: the forked code wrote this
key with `SetSync`, and
[#1546](#1546) removed the flush in
the same PR that added the RPC endpoint making the key undiscardable.
CometBFT v1.x uses the same design as this fix.

<details>
<summary>Full upstream history (how the regression happened, with
references)</summary>

- Every upstream release from v0.33 through v0.34.20 wrote this key with
`SetSync`.
- [tendermint#9159](tendermint/tendermint#9159)
+ [#9253](tendermint/tendermint#9253) (v0.34.21,
2022) downgraded it to `Set`, but *simultaneously* moved crash recovery
to a `SetSync`-written `lastABCIResponseKey` ("We always save the last
ABCI response for crash recovery"). Motivation was state.db bloat
([#8946](tendermint/tendermint#8946)), not
durability.
- tm2 took the downgrade **without** the compensating synced key, in
[#1546](#1546), commit
[c627995](c627995),
in response to a [review concern about per-tx fsync
cost](#1546 (comment)).
The reply ("we do a CommitSave just shortly after") is inverted for this
record: its only purpose, per its own doc comment, is the crash *before*
that save. The same PR added the RPC tx-results endpoint (`Tx()`
resolves a hash to a height, then reads `LoadABCIResponses` at that
height), which makes the per-height key load-bearing and undiscardable.
A survey of ~36 active tendermint descendants found no other fork with
neither mechanism.
- CometBFT v1.x restored the per-height `SetSync` and deprecated
`lastABCIResponseKey`
([#1976](cometbft/cometbft#1976),
[#2017](cometbft/cometbft#2017), backport
[#2412](cometbft/cometbft#2412)): the same
design as this PR. (Merged as a write-amplification fix; it stayed off
the v0.38 line over a compaction concern that does not apply to a plain
`Set` to `SetSync` change.)
- Upstream's split-key design only makes sense with their "discard ABCI
responses" config flag, which tm2 cannot have while the RPC endpoint
depends on the per-height key. The singleton is not bulletproof either:
it failed in production on CometBFT v0.38.17
([celestia-app#5070](celestiaorg/celestia-app#5070)).

</details>

## Production evidence

Two occurrences in two days on the same gno testnet node
(non-validator), both while it was fast-syncing after a restart and a
routine graceful stop landed inside `ApplyBlock`:

```
2026-08-20: block store = 288055, app = 288055, state = 288054, abciResponses(288055) ABSENT
2026-08-21: block store = 313891, app = 313891, state = 313890, abciResponses(313891) ABSENT
```

Offline analysis with tm2's own load functions confirmed all three
stores individually intact: no bit-rot, just the skew above. Both losses
happened on a clean process exit, no host crash, so the window is not
host-failure-only (tm2 never closes its databases on shutdown).

Note: this is the handshake replay path (`consensus/replay.go`), not the
RPC path. The same error string is widely reported by relayers as a
pruned-height symptom;
[tendermint#7039](tendermint/tendermint#7039)
is the canonical prior report of this exact height-triple, closed by
stalebot without a fix.

## The fix

With `SetSync`, the responses for H are on disk before the application
commits H, so every crash position maps onto a handshake case that
recovers:

| Crash position | Resulting heights | Handshake path |
|---|---|---|
| before the responses flush | app = state = H-1, store = H | replay H
against the real application |
| after it, before the app commit | app = state = H-1, store = H |
replay H against the real application |
| after the app commit, before the state save | app = store = H, state =
H-1 | replay H against the mock, responses guaranteed present |

The error propagation closes the second door into the same window: a
write that *fails* outright (disk full, I/O error) has nothing to flush,
and the old code proceeded to the application commit anyway. Now
`ApplyBlock` aborts while `app = state = H-1, store = H` still holds,
the healthy replay case, so the node self-recovers once the fault
clears. The handshake's InitChain-time save propagates it the same way.

This is a behavior change worth naming: a state-db write error now stops
the node loudly, where the old code carried on and deferred the failure
to an unrecoverable position. Every production caller already has an
exercised error path for it:

- consensus kills the process (matching how it already treats a failed
WAL fsync as fatal)
- fast sync panics
- the handshake fails the start with a clear error

The caller-by-caller analysis is in the ADR (`tm2/adr/`). The tx result
index write stays fire-and-forget deliberately: it is a lookup index,
rewritten on replay, not a recovery record.

**Cost:** five fsyncs per block become six (block store ×2, consensus
WAL, application store, `SaveState`, plus this one), against a 5 s
default commit interval. Fast sync pays it per block, which is precisely
the path that failed in production.

## Tests

- `TestSaveABCIResponsesIsDurable` (`state/store_test.go`): the
crash-recovery contract of the exported function.
- `TestApplyBlockFlushesABCIResponsesBeforeAppCommit`
(`state/execution_test.go`): the ordering through `ApplyBlock`;
snapshots what a restarting process would find at the instant the
application commits.
- `TestSaveABCIResponsesReturnsWriteError`: a failed write surfaces to
the caller.
- `TestApplyBlockAbortsBeforeAppCommitOnResponsesWriteError`: with a
store refusing the responses key, `ApplyBlock` returns the error and the
application's `Commit` is never invoked.

The durability pair fails with the `SetSync` reverted, with the
production error (`Could not find results for height #1`); the error
pair fails with the propagation reverted (returns nil and commits). The
doubles (`unsyncedWriteDB`, `failingWriteDB` in `state/helpers_test.go`)
model the WAL backends' behavior and the tests assert on observable
store contents after a simulated death, not on which method was called.
`go test ./tm2/pkg/bft/...` passes; `-race` on the state package is
clean.

For context, CometBFT maintainers describe this recovery mechanism as
not "well specified" and hard to test
([cometbft#3290](cometbft/cometbft#3290),
[#493](cometbft/cometbft#493)); upstream has
no equivalent coverage.

## Recovery for already-skewed stores

This PR prevents new occurrences; it does not repair a data directory
already in the skewed state. `contribs/gnobr`
([#5410](#5410), currently on
`chain/gnoland1`) can already dig such a node out, at the cost of a full
local replay (it wipes `gnolang.db` and replays from height 0). A
lighter path would be an app-store rollback of one version, like
tendermint/CometBFT's `rollback` command
([tendermint#7033](tendermint/tendermint#7033)),
which makes the handshake take the real-application replay path. A
replay-side fallback inside the handshake was considered and rejected as
unsound: rebuilding state for H needs `EndBlock`'s validator/param
updates, which are not derivable from the block, and guessing risks a
silent fork (reasoning in the ADR).

One more follow-up, out of scope here: shutdown does not drain an
in-flight `ApplyBlock` during fast sync, which is why a routine stop hit
this window. Draining narrows the window but cannot make any single
crash position recoverable, so it is complementary, not an alternative.

## AI assistance

AI-assisted; see the ADR's "AI assistance" section for what was
machine-derived and how it was reviewed. The human author reviewed and
owns the change.

## Note for operators

Until recovery tooling lands on master, recovering a skewed store means
restoring from a snapshot. Meanwhile, do not stop a catching-up node:
gate stops on `sync_info.catching_up == false`. That gate is deployed
and validated in production on the affected network's snapshot pipeline.
aeddi added a commit to gnolang/gno that referenced this pull request Nov 17, 2026
* fix(gnovm): drop clause-local names on switch fallthrough (#6056)

`fallthrough` from a clause that declares more names than the clause it
falls into panics the VM:

```go
switch 1 {
case 1:
	x := 1
	_ = x
	fallthrough
case 2:
	println("two")
}
```

```
unexpected panic: unexpected block size shrinkage: 1 vs 0
```

## Cause

All clauses of a switch share a single runtime `Block` (allocated in
`doOpExec`'s `*SwitchStmt` case). During preprocessing,
`copyFromFauxBlock` copies the switch's own names — those from its init
statement — into every clause's static block, so a clause's static block
is *switch names + that clause's own names*. When a clause matches,
`Block.ExpandWith` grows the shared block's `Values` to that clause's
name count.

`fallthrough` re-used the already-expanded block and called `ExpandWith`
again with the next clause. When the falling-through clause declared
more names than the next one, `len(b.Values)` exceeded the next clause's
`NumNames` and `ExpandWith` tripped its no-shrinkage guard
(`values.go:2951`).

## Fix

Truncate the block back to the switch's own name count before expanding
with the next clause, so it gets fresh slots of its own.

This also fixes a latent equal-size case that never panicked: two
clauses declaring the same number of names hit `ExpandWith`'s `numNames
== len(b.Values)` early return and silently reused the stale slots,
including the previous clause's `*HeapItemValue`.

Truncating is safe because the block never escapes — `doOpFuncLit`
copies `*HeapItemValue`s into `FuncValue.Captures` rather than
referencing the block — and `ExpandWith` mints fresh heap items for the
new slots, so a closure created in the previous clause keeps its own.

## Tests

Five filetests, each verified to produce identical output under real `go
run`:

| File | Covers |
|---|---|
| `switch47.gno` | the reported repro (1 name → 0 names) |
| `switch48.gno` | 3 names → 1 name, plus equal-size clauses with
differing types |
| `switch49.gno` | switch-init names surviving chained fallthroughs into
`default` |
| `switch50.gno` | fallthrough chain inside a loop (slots reused across
iterations) |
| `switch51.gno` | heap-captured clause vars on both sides of the
fallthrough |

## Related, not fixed here

Shadowing a switch-init variable inside a clause fails at preprocess
time, with or without `fallthrough`:

```go
switch v := 1; v {
case 1:
	v := "shadow" // panic: StaticBlock.Define2(v) cannot change .T; was int, new string
	println(v)
}
```

Same root design (`copyFromFauxBlock` puts the init names into the
clause's static block, so a redeclaration collides instead of
shadowing). Real Go prints `shadow`. Left for a separate change.

---

AI-assisted: the fix and tests were written with Claude Code and
reviewed before submission.

* feat: add audit pattern harness and security patterns example (#5835)

## Summary

Moves the audit pattern harness into this repo and keeps the public
builder-facing updates alongside it.

This adds:

- `misc/audit-pattern-harness`: a small audit pattern harness with YAML
expected records, sanitized fixtures, `gno test` execution, and
Markdown/JSON reports via `cmd/auditpattern`
- eight initial pattern slices:
  - `cur.Previous()` before `cur.IsCurrent()`
  - raw `Render(path)` markdown output
  - `Render` output that depends on map iteration order
  - `OriginSend()` without an `IsUserCall()` guard
  - `OriginCaller()` used as authorization identity
  - caller-supplied callbacks accepted by realm APIs
  - interfaces that expose `cur realm`
  - exported pointers or pointer getters for mutable state
- `gno.land/r/docs/security_patterns`: a compact example realm showing
authenticated mutators and safe Render output
- security-guide updates for caller-identity selection, Render output,
official markdown sanitizing guidance, and OriginCaller authorization
- Effective Gno storage guidance kept concise, with fuller tree/seqid
examples moved to `gno-data-structures.md`
- `community-packages.md`: a disclaimer-backed place for non-official
helper packages such as `moul/md`, `ulist`, `addrset`, and `fifo`
- a docs index link

The additional patterns were calibrated from local `examples/` plus
checked-out Gno contract repos including GnoSwap, Akkadia, gno-ibc, and
gno-mcp fixtures, then reduced into sanitized fixtures rather than
copying source.

## Validation

- `go test ./...` in `misc/audit-pattern-harness`
- `make run
GO=/home/russel/go/pkg/mod/golang.org/[email protected]/bin/go
AUDIT_PATTERN_FLAGS='-gno-bin /tmp/gno-audit-harness-gno'` in
`misc/audit-pattern-harness` with
`GNOROOT=/home/russel/p/gh/gnoland/gno`
- `gno test .` in `examples/gno.land/r/docs/security_patterns` with
`GNOROOT=/home/russel/p/gh/gnoland/gno`
- `gno test .` in `examples/gno.land/r/docs/home` with
`GNOROOT=/home/russel/p/gh/gnoland/gno`
- `git diff --check`

Assisted-By: OpenAI Codex

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Miguel Victoria Villaquiran <[email protected]>

* fix(gnovm): allow type-switch with sole `case nil:` (preprocess single-case branch must tag-type-only when ct is nil) (#5766)

- Before: a type-switch whose sole case was `case nil:` (e.g. `switch xx
:= x.(type) { case nil: ... }`) panicked at preprocess with `name xx not
declared` because the single-case shortcut registered the switch var
with `anyValue(ct)` where `ct == nil`; after: the sole-`nil` form is
accepted and `xx` is bound to the tag's static type, matching Go.
- `preprocess1`'s `*TypeSwitchStmt` branch in
`gnovm/pkg/gnolang/preprocess.go` now gates the `len(n.Cases) == 1`
define-with-case-type shortcut on `ct != nil`, so a nil `ct` falls
through to the same tag-type define used for multi-case switches.
- New filetest `gnovm/tests/files/typeswitch1.gno` mirrors gocorpus's
typeswitch1 (sole `case nil:` alongside mixed multi-type cases) and
exercises both the `xx := x.(type)` and bare `xx.(type)` shapes.

---------

Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>

* fix(boards2): Fix the doc for GetComments (#6090)

The doc for `GetComments` says it returns "all thread comments and
replies". Maybe this was true in an earlier version, but now it uses
[`Post.Replies`](https://github.com/gnolang/gno/blob/add66f24b895e201280e717f07e4e8cf88334593/examples/gno.land/p/gnoland/boards/post.gno#L41)
which is only direct replies. No need to filter the result. (Note that
the public API doesn't give access to `AllReplies`.)

Signed-off-by: Jeff Thompson <[email protected]>

* feat(gno.land): finish the inert-package flow, allowlist MsgRun, delegate params (#6088)

Builds on #5888 and contains it, so this supersedes that PR — please
review this
one instead. Base is master, which #5888 predates by about a month.

Under the inert policy a package is parked when submitted and only runs
once an
approver enables it. Storage gets written at both points, and this fixes
who
pays and when:

- The deposit ceiling is recorded at submit time and honored at enable,
so a
later change to the chain default cannot change what a submitter already
  agreed to.
- The namespace and CLA checks moved before the type-check. They ran
after the
  object cache was cleared, so the creator was charged nothing.
- Deleting the old package moved below the inert branch. The two
orderings
  disagreed on stored state, which is a fork.
- Re-submitting a parked package is now limited to its original creator.
  Overwrites are silent, so anyone could clobber a pending submission.
- Parking is skipped at genesis, where there is no approver and the
chain
  would fail to boot.

Other changes:

- **MsgRun allowlist.** New `run_submitters` param. Empty means today's
  behavior: anyone may send it.
- **Policy enforcement.** The check that decides whether a transaction
carries
code missed `MsgEnablePackage` and `MsgDisablePackage`. It is now an
explicit
  list that fails closed for message types added later.
- **Default deposit 600M → 100M ugnot.** This is a ceiling, not a
charge. The
largest real deploy among all 321 genesis packages is 276,098 bytes, so
the
  new ceiling clears the worst case by about 3.6x.
- **Simulation now verifies signatures on code-bearing transactions.**
It did
not, so a forged signature naming any address bought a full type-check
and
  `init()` run off one unauthenticated request.
- **Parameter delegation.** GovDAO can hand one parameter to one other
realm
and take it back at any time. The delegate may only remove entries it
added
itself. `r/nt/commondao` leaves quarantine, since it is the intended
delegate.
- **gpao fails closed.** It ignored whether the transaction it read
actually
  succeeded, so a rejected submission could still be approved.

Merging master also surfaced a determinism bug: `EnablePackage`
type-checked
with a test-file getter, which reads a test-stdlib overlay off the
node's local
disk. #6025 removed exactly that from `AddPackage` for the same reason.
Fixed
here.

Consensus-breaking: new and changed vm params, and the storage-charging
order.
The pinned multistore hash was re-derived by running the test.

ADRs are included for the inert charging work and the delegation design.
AI-assisted, reviewed by me before pushing.

---------

Co-authored-by: moul <[email protected]>
Co-authored-by: Thomas <[email protected]>

* fix(gno.land): post-merge fixes for inert packages (#6093)

3 fixes/commits :

- `MsgRejectPackage`: don't check inert approvers for genesis txs
e09e68c069a7efb1150c2e0ccb32bbff104e0ae7
- Deny new `MsgRejectPackage` to session keys (just like
`MsgAddPackage`, `MsgEnablePackage` and `MsgDisablePackage`)
ce7f217a783477dfafb4239b1e2b3b9081639fe0
- Add missing out-of-gas panic recover from new `QueryInertPaths`

---------

Co-authored-by: moul <[email protected]>

* perf(gnovm,tm2,gno.land): size-aware encode, decode and render paths

Rework a set of hot paths so that work and allocation scale with the actual
input rather than with a declared or worst-case size: stream the nested
interface JSON encoder, size Gno->Go slice conversions by length instead of
capacity, render BitArray from its backing data, make uniqueDecls O(n), bound
the recursive predefine declaration lookup, price the flat-fee natives on
their real operand size, and vendor a bounded toml decoder for gnomod.toml.

Also tightens a few input validators (multisig key structure, ParseCoins,
gnokms authkeys, gnoweb URL schemes and path length, markdown reader
lifetime), bounds the per-connection p2p receive buffer and the WAL backwards
search, gives the remote signer a dial timeout, errors on unverifiable Merkle
proofs, reworks the grc20 teller surface so the frame-relative teller stays
within the token's own realm, and fixes params baseline handling on a
net-zero storage diff.

Co-authored-by: Morgan Bazalgette <[email protected]>
Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: moul <[email protected]>
Co-authored-by: davd-gzl <[email protected]>

* test(grc20): assert cross-realm event provenance (#6092)

## Summary

Adds `event_provenance_filetest.gno`, the cross-realm counterpart to the
existing `newtoken_event_filetest.gno`. Test-only; no production code
changes.

Related: #6026, #6042.

## Motivation

`newtoken_event_filetest.gno` (#6042) covers the *within-realm* case: a
realm that reuses a `seqid` announces the same `Token.ID()` twice, so an
indexer can flag it.

The *cross-realm* case has never been pinned by a test, which left the
harder question open: given a `Transfer` event, how does a consumer
decide which realm issued the token? Two fields are involved and neither
is sufficient alone:

- **`pkg_path`** is stamped by the VM from the package whose code calls
`chain.Emit` (`gnovm/stdlibs/chain/emit_event.go`). Every genuine grc20
event therefore carries `gno.land/p/demo/tokens/grc20` — a constant
across the ecosystem, so it identifies the library but never the token.
- **the `token` attribute** carries `Token.ID()`, whose leading
component is `rlm.PkgPath()` captured under `IsCurrent()` in `NewToken`.

Chained, they are sufficient: `pkg_path` proves the event came from
grc20's code, and grc20's code only ever writes an `IsCurrent`-verified
realm prefix into `token`. So for any event bearing grc20's `pkg_path`,
the realm prefix inside `token` is unforgeable.

That property is what the indexer rule rests on, and until now nothing
in the tree would have caught a regression in it.

## What the filetest pins

An impostor realm tries both routes available to it against a canonical
registered token (`foo20`), and fails at each:

1. **Ask grc20 for it.** `NewToken("Foo", "FOO", 4, 0, cur)` — same
name, symbol, decimals and id as foo20 — yields
`gno.land/r/demo/grc20provenance.FOO.0000000`. The id prefix comes from
the live crossing frame, so no argument can make it name another realm.
2. **Bypass grc20.** A hand-emitted `Transfer` carrying foo20's exact id
is stamped `"pkg_path": "gno.land/r/demo/grc20provenance"`. An indexer
accepting `Transfer` only from grc20's `pkg_path` drops it.

The asserted `// Events:` block contains all three events, so the two
`pkg_path` values and both id prefixes are part of the expectation
rather than prose.

## The resulting indexer rule

1. Accept grc20 token events only when `pkg_path ==
"gno.land/p/demo/tokens/grc20"`.
2. Read the issuing realm from the leading component of the `token`
attribute.
3. Flag any realm that announces the same `Token.ID()` in more than one
`NewToken` event.

Steps 1–2 settle provenance across realms; step 3 is the within-realm
signal from #6042. Together they cover the ambiguity described in #6026
without a change to the standard.

## Testing

```
gno test -C examples ./gno.land/p/demo/tokens/... ./gno.land/r/demo/defi/...
gno fmt -diff -C examples ./gno.land/p/demo/tokens/grc20/...
gno lint -C examples ./gno.land/p/demo/tokens/grc20/...
```

No ADR: test-only, and it documents existing behaviour rather than
deciding anything (AGENTS.md exempts simple tests).

* feat(gnovm): add chain params reader API" (#6094)

Continues #5698 by @notJoon, which went stale in May. Their commits are
preserved with authorship; I merged master (resolving conflicts in
native_gas.go and the crossrealm38 hash pin) and added documentation
plus a test for wrong-type reads.

Superseding #5698 rather than pushing to their fork so their branch is
left alone. Happy to close this if @notJoon would rather carry it
themselves.

Outstanding: the six chain/params Get* gas rows are copied from the
matching Set* rather than fitted — native_bench_output.txt has no
samples for them. The benchmarks are in this PR; they need a run on the
reference machine.

---------

Co-authored-by: Lee ByeongJun <[email protected]>

* feat(grc721): rewrite core on the Token/PrivateLedger/Teller axis (1/4) (#6072)

## Summary

Rewrites `p/demo/tokens/grc721` around a `Token` / `PrivateLedger` /
`Teller` axis, replacing the old `BasicNFT` monolith, and migrates every
in-tree consumer in the same change.

This is the first of five PRs split out of #6029, which was too large to
review in one piece.
Each PR builds, lints and tests green on its own.

## Motivation

Three properties of the old API made it hard to use safely under the
current interrealm spec:

- **Caller identity was an argument.** Every writer took `caller
address`, so the calling realm asserted who it was. Nothing tied that
address to the frame actually crossing in, and each consumer
re-implemented the check.
- **Reads and writes shared one handle.** `*BasicNFT` carries exported
mutators, so handing it to another realm is a write-authority grant
under borrow rule 2 — the type could not be exposed, only wrapped.
- **Extensions were in-package.** Metadata and royalty lived inside the
core package, so every collection paid their storage and gas cost
whether or not it used them.

GRC20 had already converged on a Token/Ledger/Teller shape; GRC721
diverging from it forced consumers to learn two mental models for the
same problem.

## What changes

- **Core rewrite** — `token.gno`, `tellers.gno` and `types.gno` replace
`basic_nft.gno`, `igrc721*.gno`, `util.gno` and the in-package
metadata/royalty files. `Token` is the read surface, `PrivateLedger` is
the unshared write authority the issuer keeps, and `Teller` is a
capability that writes *as some account*: it takes a secondary `rlm
realm` and rejects it with `ErrSpoofedRealm` unless `rlm.IsCurrent()`
holds. Five grades cover the realistic cases — `CallerTeller`,
`ReadonlyTeller`, `RealmTeller`, `RealmSubTeller`, and the issuer-only
`ImpersonateTeller`.
- **`NewToken` event** on token creation, with a filetest covering the
emitted attributes.
- **Extension hooks** — `RegisterExtension` attaches an issuer-supplied
`Extension` whose `OnMint` / `OnTransfer` / `OnBurn` fire on every
movement. `ExtensionKind` is the identity: one extension per kind, and a
second registration of an attached kind panics. Hooks run after the
ledger write but before the movement event is emitted, so a hook that
panics vetoes the announcement as well as the transaction.
- **EIP-721 conformance fixes** — `Approve(zero)` now revokes a
per-token approval instead of being rejected; `GetApproved` reports
`ErrInvalidTokenId` for a token that is not a valid NFT, rather than
collapsing it into "not approved"; `SetApprovalForAll(op, false)`
releases the operator entry instead of storing `false`.
- **Docs** — `IsCanonicalTeller` is documented as an authenticity check
on the implementation, not an authorization guard on the acting account;
the issuer-hook trust property is stated explicitly.
- **Consumer migration** — `btree_dao`, `eventix`, `tokenhub` and
`foo721` move to the new API in this same PR, so `examples/` never
breaks. `foo721` stays core-only here and grows into the full showcase
in the last PR of the series.
- **Integration test** — `grc721_emit.txtar` is rewritten against the
new core events.

## Teller confinement

`CallerTeller` resolves the acting account from the calling frame, so it
acts as whoever crossed into the realm holding it. That is meaningful
inside the token's own realm, where the wrappers act for a caller who
knowingly invoked the collection. Anywhere else it is a confused deputy,
and `*Token` is a published pointer — exported vars, the collection
facade, `grc721reg.GetToken` — so any realm could otherwise mint one and
take the NFTs of whoever called it. `TransferFrom` is the sharp case: it
resolves the *spender* from the frame, so a realm reached from an honest
hub spends that hub's approvals against any owner who granted one.

Two layers, matching the Token/Ledger split this PR introduces:

- **Construction privacy** — `CallerTeller` hangs off `*PrivateLedger`,
not `*Token`. The token pointer travels; the ledger does not, since
`NewToken` hands it to the creating realm and nowhere else.
- **A write-time home check** — privacy alone is insufficient, because a
realm may legally build a teller and then export the *value*.
`guardHome` compares the invoking realm against `Token.origRealm` on
every write, leaving a leaked teller inert everywhere but home.

`origRealm` is captured in `NewToken` from `rlm.PkgPath()` under the
existing `IsCurrent` assertion, with any `":subpath"` from `realm.Sub`
stripped on both the stored and the invoking side, so a token created
from a sub frame is not locked out of its own host and a host's
sub-realms are not falsely rejected. `Token.ID()` keeps the raw path, so
identities and the `NewToken` event are unchanged.

The guard keys on the invoking realm alone, deliberately not on whether
the resolved actor is an end user: keying on the actor blocks only the
case where the debited party is the signing user, and leaves a realm
chargeable by a realm it calls.

The supported route for a realm that must move someone else's tokens is
unchanged: the owner `Approve`s it, and it spends as itself through
`RealmTeller`, which is eagerly bound to its own address and
approval-gated.

This matches the teller surface `grc20` carries on master as of acd01fa.

## Breaking change

The old surface is removed wholesale:

- **Core** — `BasicNFT`, `NewBasicNFT`, the `IGRC721Reader` interface,
the `NFTGetter` indirection and the `TokenURI` type.
- **Metadata / royalty** — `NewNFTWithMetadata`, `NewNFTWithRoyalty`,
`IGRC721Metadata`, `IGRC721MetadataOnchain`,
`IGRC721CollectionMetadata`, `IGRC2981`, `Metadata`, `Trait` and
`RoyaltyInfo`. These return as opt-in extensions in #6073.
- **Dropped with no replacement** — `SafeMint` and `SafeTransferFrom`
(EIP-721's receiver check needs a registry, and aliasing it under the
same name would imply a safety this package cannot provide), plus
`TokenURI` / `SetTokenURI` and `Getter()`.

Renamed on the read surface: `Name()` → `GetName()`, `Symbol()` →
`GetSymbol()`, `TokenCount()` → `TotalSupply()`.

Kept identical, so migrating readers is mechanical: `BalanceOf(address)
(int64, error)`, `OwnerOf`, `GetApproved`, `IsApprovedForAll`, `Mint`,
`Burn`, `RenderHome`.

Writers change shape by design: the `caller address` argument is gone,
and the acting account is derived from the crossing frame by a `Teller`
— see Motivation.

Per AGENTS.md, breaking `gno.land/p/demo/` backwards-compat needs
discussion, so flagging it explicitly: the package is not part of the
current testnet genesis set, and every in-tree consumer lives under
`examples/quarantined/`, so the blast radius is limited to this
repository.

Publishing the new API under a parallel `/v2` path was considered and
rejected — it would mean a permanent double surface for a package with
no external consumers on chain.

## Testing

- `gno fmt -diff -C examples ./...`
- `gno lint -C examples ./...`
- `gno test -C examples ./gno.land/p/demo/tokens/grc721/...
./quarantined/...`
- `go test ./gno.land/pkg/integration/ -run 'TestTestdata/grc721'`

`grc721_callerteller_home.txtar` covers both foreign-realm paths — a
frame-resolved `TransferFrom` and a `SetApprovalForAll` land-grab — and
asserts the teller **still works at home**, so the guard is scoped
rather than a blanket disable.

Negative control: returning early from `guardHome` makes the
`TransferFrom` attack succeed and the txtar fail on both the
expected-failure and the error-message assertions.

## The rest of the series

Split out of #6029. All five target `master`; the later four are drafts
and should merge in this order, since each builds on the previous one:

1. core(**this PR**) — core rewrite + consumer migration
2. extensions(#6073) — metadata / royalty / enumerable
3. collection(#6074) — read-only `Collection` + `NFT` handle
4. grc721reg(#6075) — collection registry

---------

Co-authored-by: moul <[email protected]>

* feat(grc721): add stackable metadata, royalty, and enumerable extensions (2/4) (#6073)

## Summary

Adds three independent, stackable extensions on top of the new GRC721
core.
Each lives in its own package, wraps a core token's ledger, and can be
composed freely — a collection may use none, one, or all three.

Second of five PRs split out of #6029.

## What changes

- **`grc721/metadata`** — EIP-721 Metadata plus the OpenSea attribute
convention. Emits `TokenURIUpdate` / `MetadataUpdate`.
- **`grc721/royalty`** — EIP-2981 royalty info, with per-token overrides
on top of a collection default and a configurable bps cap.
- **`grc721/enumerable`** — EIP-721Enumerable, backed by AVL trees so
iteration order is deterministic.

Each package ships its own `gnomod.toml` and a full unit-test suite.

## Design notes

Extensions wrap rather than embed.
Each constructor takes the core `*PrivateLedger` and returns a read view
plus its own ledger, registering an `Extension` hook (`OnMint` /
`OnTransfer` / `OnBurn`) on the core.
Hooks take no `realm` parameter, so they cannot capture a `cur`, and
only the issuer can attach one.

The flip side — an attached hook runs issuer code on every movement and
can veto a transfer by panicking, and gas scales linearly with the
extension count — is documented as an explicit trust grant rather than
left implicit.

## Reviewing this PR

Draft until the core rewrite (first PR of the series, #6072) merges.
Both target `master`, so the diff below still contains the core commits
until then.

---------

Co-authored-by: moul <[email protected]>

* feat: pearl testnet release candidate (#6091)

Co-authored-by: gfanton <[email protected]>
Co-authored-by: moul <[email protected]>

* fix(tm2): /genesis output not amino-decodable (#6098)

This doesn't affect standard nodes: only gnodev, in-memory nodes,
pkg/integration and the gnogenesis contribs are affected.

Essentially when the genesis app state type doesn't implement
`StreamableResult` (has no `StreamJSON()` method), /genesis misses the
amino `@type` field for the `app_state` field, which makes the output
not aminoJSON decodable.

* refactor(tm2)!: make vesting a field on BaseAccount, not an account type (#6095)

Vesting was three account types, and the bank decided whether to apply a
lock by
type-asserting a stored account to `std.VestingAccount`. That assertion
was the
entire enforcement contract, and it was silent whenever it missed.

It missed. gno.land builds accounts as `*GnoAccount`, while genesis
built
`*ContinuousVestingAccount` from a plain `std.BaseAccount` — so a
vesting account
was not a gno.land account. Three consequences, each verified before
changing
anything:

1. It does not implement `std.AccountUnrestricter`, so while ugnot is a
restricted
denom `canSendCoins` finds no whitelist bit and refuses **every**
transfer. The
   vesting lock is never even consulted.
2. `applyUnrestrictedAddrs` does an unchecked `acc.(*GnoAccount)`, so
listing a
vesting address in `UnrestrictedAddrs` **panics the chain during
InitChain**:
`interface conversion: std.Account is *std.BaseAccount, not
*gnoland.GnoAccount`.
3. `gnoclient.QueryAccount` unmarshals every account into a concrete
`gnoland.GnoAccount`, and a vesting account's JSON carried a
`VestingSchedule`
   field that type had no place for. Querying one failed outright with
`unknown JSON field "VestingSchedule"` — **no client could read a
vesting
   account at all**.

`docs/CONSTITUTION.md` requires the configuration that panicked:
*"Whitelisted
funds remain subject to the vesting schedule."* Vesting accounts were
effectively
non-functional on gno.land.

## The change

One account type. `BaseAccount` gains a `VestingSchedule` field, the
schedule
gains the vesting maths, and `std.Account` gains `GetVesting`,
`SetVesting` and
`LockedCoins`. Enforcement reads the field, so which concrete type is
stored
decides nothing.

Deleted: the `VestingAccount` interface, all three account types, both
constructors, `SpendableCoins`, `upgradeVestingAccount`, the `upgraded`
flag
threaded through `subtract`, and `vestingScheduleOf`.

Adding interface methods costs nothing here: `SetAddress` is implemented
exactly
once in the whole tree, on `*BaseAccount`, so every account type already
inherits
by embedding and no independent implementer exists.

`VestingSchedule.Type` now selects the curve at read time instead of
selecting a
type at genesis, so it can no longer disagree with how an account
actually vests.
`upgradeVestingAccount` is gone because there is nothing left to upgrade
— an
elapsed schedule already locks nothing, so collapsing it saved nothing
and cost a
write on a path that could still fail.

### This does not move the app hash

genproto2 emits a struct field only when it marshals to non-zero length,
and a
zero `VestingSchedule` marshals to nothing, so an account without
vesting encodes
byte-for-byte as before. `json:",omitempty"` does the same for JSON, and
the two
are independent — the binary encoding does not depend on the tag.

Measured, not argued: the integration txtar suite, whose goldens contain
account
query output, passes unchanged.

### Breaking state change

Removing the three amino-registered types means state holding one stops
decoding.
Only genesis ever created them and a fork re-parses the text balances
file, so a
fresh or re-genesised chain is unaffected. **Safe because the chain is
pre-mainnet**; a live chain would need a migration.

## Fixes found alongside

Auditing this turned up three faults in how the genesis balance format
is read and
written. **None is caused by the redesign** — master has all three — but
each
decides whether a vesting schedule survives, so they are fixed here
rather than
left beside code that now depends on them.

- **`gnogenesis balances add` silently unlocked accounts.** `LeftMerge`
only fills
in absent addresses and the input sheets merge first, so overriding an
address's
amount dropped its schedule. Silent: what remains looks like any
ordinary
balance. A tx export names every address that ever transacted, so a
vesting
  investor who made one transaction came out unlocked.
- **`gnoland start --genesis-balances-file` rejected vesting entries.**
It read the
sheet with its own split-on-`=` parser, which sees three fields in a
vesting
line. The file `gnogenesis` writes was refused at boot. Now delegates to
the same
  parser, deleting the duplicate.
- **`balances add`'s summary print dropped the suffix** that `balances
export`
  keeps.

The pattern in each: the account now has one owner of what vesting
means, but the
text format had several.

## Changes by area

**tm2/pkg/std** — `Vesting` field on `BaseAccount`;
`GetVesting`/`SetVesting`/
`LockedCoins` on `std.Account`; `vesting.go` replaces
`vesting_account.go` with
the schedule owning its own maths; three amino registrations removed;
`pb3_gen.go` and `std.proto` regenerated by genproto2 (`vesting = 6`,
appended,
fields 1–5 untouched).

**tm2/pkg/sdk/bank** — `SubtractCoins` reads the field instead of
asserting;
`upgradeVestingAccount` and the `upgraded` flag deleted; `subtract` now
reads the
account when the caller passes nil, so nil means "I do not have it" in
both halves
of that function; the account-tier invariant validates the field.

**gno.land/pkg/gnoland** — `applyBalance` builds one account type and
sets the
schedule, with the `Validate`/`IsAllGTE` guards that lived in the
constructors;
`LoadGenesisBalancesFile` delegates to the canonical sheet parser.

**contribs/gnogenesis** — the two `balances` fixes above, plus a
`verify` warning
when a schedule ends at or before genesis or more than a century after
it
(warns rather than rejects, since fork replay legitimately carries
past-dated
schedules).

**Tests** — schedule arithmetic across boundaries, monotonicity and
conservation
over whole schedules including `MaxInt64`; the vesting-plus-whitelist
regression;
`applyBalance`'s guards; the sheet→genesis→enforcement seam; schedule
survival
across the gas path; the two behaviours mutation showed were free to
change (the
`lockedAmt == 0` shortcut and the `max(...,0)` clamp).

**ADRs** — `tm2/adr/prxxxx_vesting_as_an_account_field.md` and
`tm2/adr/prxxxx_vesting_schedule_sharp_edges.md`. *(Rename both once the
PR
numbers exist.)*

## Verification

- `go test ./tm2/pkg/std/ ./tm2/pkg/sdk/... ./gno.land/pkg/gnoland/...
-count=1` — pass
- `go test ./... -count=1` in `contribs/gnogenesis` — pass
- `go test ./gno.land/pkg/integration/ -run TestTestdata -count=1` —
pass
- `go test ./gno.land/pkg/sdk/vm/ -run Gas -count=1` — pass
- `golangci-lint run --config .github/golangci.yml ./...` — 0 issues
- `make fix` — no-op

Every behavioural change was mutation-tested: the mutation applied,
confirmed to
compile, the test run, then restored and the tree diffed. Notable ones —
giving
`BaseVestingAccount` the three methods fails the interface and hazard
tests;
reverting `applyBalance` to the old shape reproduces the genesis panic
verbatim;
dropping either `applyBalance` guard fails exactly its own two cases;
removing the
`balances add` carry-over fails only the override case.

## Known gap

Vesting has no end-to-end txtar coverage, and the harness cannot
currently express
it — `adduser` parses its amount with `std.ParseCoins`, and `gnoland
start` has no
balances-file flag. Closing that means extending the integration
harness, which
belongs in its own change.

AI-assisted: audit, implementation and tests written with Claude Code,
reviewed
before submission.

* chore(deps): bump brace-expansion from 5.0.6 to 5.0.9 in /gno.land/pkg/gnoweb/frontend (#5992)

Bumps `brace-expansion` from 5.0.6 to 5.0.9 in
`/gno.land/pkg/gnoweb/frontend`.

This PR was originally opened by Dependabot targeting 5.0.7. Two further
high-severity advisories were published after it was opened, so the
lockfile
was bumped manually to 5.0.9 — the current `latest` on npm — to close
all of
them in a single change:

| Advisory | Fixed in | Covered by 5.0.7? |
| --- | --- | --- |
| CVE-2026-13149 — exponential-time expansion of consecutive `{}` groups
| 5.0.7 | yes |
| CVE-2026-14257 — OOM crash via unbounded expansion length | 5.0.8 | no
|
| CVE-2026-69152 — DoS bypassing the CVE-2026-14257 mitigation | 5.0.9 |
no |

`brace-expansion` is a dev-only transitive dependency (`minimatch` <-
`glob`,
`nodemon`), so the shipped gnoweb bundle is unaffected; the exposure was
limited
to the frontend build tooling.

Notes:
- `[email protected]` requires `brace-expansion@^5.0.5`, so 5.0.9
resolves within
range and no other package moved. The diff is confined to the four lines
of
  the `brace-expansion` entry.
- The `integrity` hash was verified against a SHA-512 computed from the
  published tarball.
- 5.0.9 narrows `engines.node` from `18 || 20 || >=22` to `20 || >=22`;
CI runs
  `lts/Jod` (Node 22), so this is a no-op here.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexis Colin <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

* fix(tm2): fsync the ABCI responses record and stop the block when its write fails (#6085)

## Summary

A node killed between the application's commit of height H and
`SaveState(H)` loses the stored ABCIResponses for H. Every subsequent
start then fails the ABCI handshake with:

```
error during handshake: error on replay: Could not find results for height #H
```

The node never recovers on its own. The record exists precisely to cover
this crash window, but it was written without a flush, so it died in the
same crash it was supposed to protect against. This bricked the same
production node twice in two days.

The fix is two small changes in `SaveABCIResponses`:

1. `db.Set` becomes `db.SetSync`, so the record is on disk before the
application commits.
2. Its write error (previously discarded) is returned, so `ApplyBlock`
stops the block *before* the application commit instead of committing a
height whose recovery record was never stored.

Fixes [#6055](https://github.com/gnolang/gno/issues/6055).

<details>
<summary>Mapping to #6055's items (two are deliberately scoped
out)</summary>

The missing flush and the dropped `SaveABCIResponses` error are fixed
here, with regression tests. Scoped out:

- `SaveState`'s own dropped error: past the application commit a save
failure has no in-place remedy (the app is already at H), so returning
it buys no recovery. Reasonable follow-up.
- A handshake-level test against an *already*-skewed directory: a skewed
store cannot be repaired at handshake time; that scenario belongs to
recovery tooling (see "Recovery for already-skewed stores").

</details>

## Root cause

`BlockExecutor.ApplyBlock` persists a block in this order
(`tm2/pkg/bft/state/execution.go`):

1. `SaveABCIResponses(db, H, …)`, a plain `db.Set`
2. the tx result index, also plain `db.Set`
3. `proxyApp.CommitSync()`: the application store commit, atomic and
fsynced
4. `SaveState(db, state)`, which ends in `db.SetSync`

On the WAL-based backends `Set` is unsynced (pebbledb, the production
default, passes `pebble.NoSync`), so steps 1 and 2 become durable only
when step 4 flushes the log. A death between 3 and 4 loses the responses
**and** the state while the block store and the application keep H:

```
block store = H, application = H, state = H-1, abciResponses(H) = missing
```

`Handshaker.ReplayBlocks` handles this shape by replaying H against a
mock application that serves the stored responses (the real application
must not re-execute a height it already committed). `LoadABCIResponses`
is its only source and there is no fallback: startup fails
deterministically, forever.

This is a regression, not a design choice: the forked code wrote this
key with `SetSync`, and
[#1546](https://github.com/gnolang/gno/pull/1546) removed the flush in
the same PR that added the RPC endpoint making the key undiscardable.
CometBFT v1.x uses the same design as this fix.

<details>
<summary>Full upstream history (how the regression happened, with
references)</summary>

- Every upstream release from v0.33 through v0.34.20 wrote this key with
`SetSync`.
- [tendermint#9159](https://github.com/tendermint/tendermint/pull/9159)
+ [#9253](https://github.com/tendermint/tendermint/pull/9253) (v0.34.21,
2022) downgraded it to `Set`, but *simultaneously* moved crash recovery
to a `SetSync`-written `lastABCIResponseKey` ("We always save the last
ABCI response for crash recovery"). Motivation was state.db bloat
([#8946](https://github.com/tendermint/tendermint/issues/8946)), not
durability.
- tm2 took the downgrade **without** the compensating synced key, in
[#1546](https://github.com/gnolang/gno/pull/1546), commit
[c627995](https://github.com/gnolang/gno/commit/c627995589676bb95a7a2a3b6f341a25a72c02cc),
in response to a [review concern about per-tx fsync
cost](https://github.com/gnolang/gno/pull/1546#discussion_r1497945114).
The reply ("we do a CommitSave just shortly after") is inverted for this
record: its only purpose, per its own doc comment, is the crash *before*
that save. The same PR added the RPC tx-results endpoint (`Tx()`
resolves a hash to a height, then reads `LoadABCIResponses` at that
height), which makes the per-height key load-bearing and undiscardable.
A survey of ~36 active tendermint descendants found no other fork with
neither mechanism.
- CometBFT v1.x restored the per-height `SetSync` and deprecated
`lastABCIResponseKey`
([#1976](https://github.com/cometbft/cometbft/issues/1976),
[#2017](https://github.com/cometbft/cometbft/pull/2017), backport
[#2412](https://github.com/cometbft/cometbft/pull/2412)): the same
design as this PR. (Merged as a write-amplification fix; it stayed off
the v0.38 line over a compaction concern that does not apply to a plain
`Set` to `SetSync` change.)
- Upstream's split-key design only makes sense with their "discard ABCI
responses" config flag, which tm2 cannot have while the RPC endpoint
depends on the per-height key. The singleton is not bulletproof either:
it failed in production on CometBFT v0.38.17
([celestia-app#5070](https://github.com/celestiaorg/celestia-app/issues/5070)).

</details>

## Production evidence

Two occurrences in two days on the same gno testnet node
(non-validator), both while it was fast-syncing after a restart and a
routine graceful stop landed inside `ApplyBlock`:

```
2026-08-20: block store = 288055, app = 288055, state = 288054, abciResponses(288055) ABSENT
2026-08-21: block store = 313891, app = 313891, state = 313890, abciResponses(313891) ABSENT
```

Offline analysis with tm2's own load functions confirmed all three
stores individually intact: no bit-rot, just the skew above. Both losses
happened on a clean process exit, no host crash, so the window is not
host-failure-only (tm2 never closes its databases on shutdown).

Note: this is the handshake replay path (`consensus/replay.go`), not the
RPC path. The same error string is widely reported by relayers as a
pruned-height symptom;
[tendermint#7039](https://github.com/tendermint/tendermint/issues/7039)
is the canonical prior report of this exact height-triple, closed by
stalebot without a fix.

## The fix

With `SetSync`, the responses for H are on disk before the application
commits H, so every crash position maps onto a handshake case that
recovers:

| Crash position | Resulting heights | Handshake path |
|---|---|---|
| before the responses flush | app = state = H-1, store = H | replay H
against the real application |
| after it, before the app commit | app = state = H-1, store = H |
replay H against the real application |
| after the app commit, before the state save | app = store = H, state =
H-1 | replay H against the mock, responses guaranteed present |

The error propagation closes the second door into the same window: a
write that *fails* outright (disk full, I/O error) has nothing to flush,
and the old code proceeded to the application commit anyway. Now
`ApplyBlock` aborts while `app = state = H-1, store = H` still holds,
the healthy replay case, so the node self-recovers once the fault
clears. The handshake's InitChain-time save propagates it the same way.

This is a behavior change worth naming: a state-db write error now stops
the node loudly, where the old code carried on and deferred the failure
to an unrecoverable position. Every production caller already has an
exercised error path for it:

- consensus kills the process (matching how it already treats a failed
WAL fsync as fatal)
- fast sync panics
- the handshake fails the start with a clear error

The caller-by-caller analysis is in the ADR (`tm2/adr/`). The tx result
index write stays fire-and-forget deliberately: it is a lookup index,
rewritten on replay, not a recovery record.

**Cost:** five fsyncs per block become six (block store ×2, consensus
WAL, application store, `SaveState`, plus this one), against a 5 s
default commit interval. Fast sync pays it per block, which is precisely
the path that failed in production.

## Tests

- `TestSaveABCIResponsesIsDurable` (`state/store_test.go`): the
crash-recovery contract of the exported function.
- `TestApplyBlockFlushesABCIResponsesBeforeAppCommit`
(`state/execution_test.go`): the ordering through `ApplyBlock`;
snapshots what a restarting process would find at the instant the
application commits.
- `TestSaveABCIResponsesReturnsWriteError`: a failed write surfaces to
the caller.
- `TestApplyBlockAbortsBeforeAppCommitOnResponsesWriteError`: with a
store refusing the responses key, `ApplyBlock` returns the error and the
application's `Commit` is never invoked.

The durability pair fails with the `SetSync` reverted, with the
production error (`Could not find results for height #1`); the error
pair fails with the propagation reverted (returns nil and commits). The
doubles (`unsyncedWriteDB`, `failingWriteDB` in `state/helpers_test.go`)
model the WAL backends' behavior and the tests assert on observable
store contents after a simulated death, not on which method was called.
`go test ./tm2/pkg/bft/...` passes; `-race` on the state package is
clean.

For context, CometBFT maintainers describe this recovery mechanism as
not "well specified" and hard to test
([cometbft#3290](https://github.com/cometbft/cometbft/issues/3290),
[#493](https://github.com/cometbft/cometbft/issues/493)); upstream has
no equivalent coverage.

## Recovery for already-skewed stores

This PR prevents new occurrences; it does not repair a data directory
already in the skewed state. `contribs/gnobr`
([#5410](https://github.com/gnolang/gno/pull/5410), currently on
`chain/gnoland1`) can already dig such a node out, at the cost of a full
local replay (it wipes `gnolang.db` and replays from height 0). A
lighter path would be an app-store rollback of one version, like
tendermint/CometBFT's `rollback` command
([tendermint#7033](https://github.com/tendermint/tendermint/pull/7033)),
which makes the handshake take the real-application replay path. A
replay-side fallback inside the handshake was considered and rejected as
unsound: rebuilding state for H needs `EndBlock`'s validator/param
updates, which are not derivable from the block, and guessing risks a
silent fork (reasoning in the ADR).

One more follow-up, out of scope here: shutdown does not drain an
in-flight `ApplyBlock` during fast sync, which is why a routine stop hit
this window. Draining narrows the window but cannot make any single
crash position recoverable, so it is complementary, not an alternative.

## AI assistance

AI-assisted; see the ADR's "AI assistance" section for what was
machine-derived and how it was reviewed. The human author reviewed and
owns the change.

## Note for operators

Until recovery tooling lands on master, recovering a skewed store means
restoring from a snapshot. Meanwhile, do not stop a catching-up node:
gate stops on `sync_info.catching_up == false`. That gate is deployed
and validated in production on the affected network's snapshot pipeline.

* fix(docs): don't link-check chain RPC endpoints (#6100)

## Problem

`ci / codegen-verify` (the `docs` matrix leg) is red on `master`, and
has been since 2026-08-27. [Failing
run](https://github.com/gnolang/gno/actions/runs/33150009390):

```
found items that need linting
Remote links that need checking:
>>> https://rpc.gno.land:443 (found in file: docs/resources/gas-fees.md)
>>> https://rpc.gno.land:443 (found in file: docs/users/interact-with-gnokey.md)
... (11 occurrences)
exit status 1
make: *** [Makefile:2: lint] Error 1
```

The links are not actually broken. `rpc.gno.land` is serving a
certificate issued for `rpc.betanet.testnets.gno.land` that **expired on
2026-08-27 14:05 UTC**:

```
$ echo | openssl s_client -connect rpc.gno.land:443 -servername rpc.gno.land \
    | openssl x509 -noout -subject -dates
subject=CN=rpc.betanet.testnets.gno.land
notBefore=May 29 14:05:45 2026 GMT
notAfter=Aug 27 14:05:44 2026 GMT
```

The docs linter GETs every remote URL it finds, so the TLS verification
failure surfaces as eleven "broken" links and fails the job.

## Fix

The linter shouldn't be link-checking chain RPC endpoints at all. They
are JSON-RPC APIs, not documentation pages — the response to a plain GET
says nothing about whether the documented endpoint is correct, while it
does make docs CI depend on a live chain's uptime and TLS certificate.

This skips `rpc.*` hosts, which is the same reasoning already applied to
`staging.gno.land` in that file ("deployment-specific hosts whose uptime
is not a CI concern"). It also covers `rpc.pearl.testnets.gno.land`,
which would hit the identical problem at its next certificate rotation.

While here, the exclusion condition — now eight entries with interleaved
comments — moves out of the `if` into `shouldCheckURL`, and the RPC
check runs against the parsed hostname so a path segment like
`https://example.org/rpc.gno.land` is still checked.

`docs/README.md` and the other docs are untouched; the URLs stay exactly
as they are.

## Verification

```
$ cd docs && make lint
Lint complete, no issues found.

$ cd misc/docs/tools/linter && go test ./...
ok
```

`make generate` in `docs/` leaves the tree clean, so the other half of
the `codegen-verify` job is unaffected.

New tests cover the skip list and the hostname-vs-path distinction.

## Still needed (infra, not this PR)

**The `rpc.gno.land` certificate needs renewing.** This PR only stops
docs CI from failing on it; betanet's RPC endpoint is currently unusable
for anything that verifies TLS.

---

Written with AI assistance (Claude Code); reviewed before submitting.

* chore(gno.land)!: remove unused MsgDisablePackage (#6130)

MsgDisablePackage was wired through every layer -- registered in the
amino codec as m_disable_pkg, routed by vmHandler.Process, covered by
txCarriesCode and sessionAlwaysDenied, matched by gnokey's
txNeedsSimulationSignature -- but its keeper method only ever checked
the approver gate and returned "disable_package is not yet implemented".
So the whole surface existed for a message whose only possible outcome
was an error, and the tests pinned that error rather than any behaviour.

The follow-up that would have implemented it never landed, and #6088's
own review notes record why it is not small: it needs eviction of
executed objects from the base store, and the storage deposit taken at
enable would have to be released. Neither has a design.

Its purpose is also unclear. MsgRejectPackage already covers the
operationally needed case -- clearing a package parked awaiting
approval, on the creator's or an approver's request. What is left for
disable is un-deploying live code, which raises questions this series
never answered: what happens to callers that imported the package, to
its realm state, to its storage deposit, and to the addresses that paid
it. That is a design discussion, and it does not need a placeholder
message on the wire to start.

Removes the message, its keeper stub, its route, its amino registration
and the layers that enumerated it; regenerates pb3_gen.go and vm.proto
with `make -C misc/genproto2`; and drops the stub-only tests along with
the disable_package rows in the codec-parity, txCarriesCode,
session-deny and simulation-signature tables. Comments that named the
stub are updated in place.

Nothing that worked stops working, since the message had no success
path. It does unregister the m_disable_pkg amino type, so
vm/disable_package no longer decodes: a chain whose history contains
such a transaction -- it could only fail, but a failed message is still
committed into a block -- cannot replay that block on a post-removal
binary. chain/pearl registers the type, so check before upgrading a
pearl node across this change rather than restarting from a fresh
genesis. No mainnet is affected; there is none.

Closes #6125

* fix(gpao): derive a dependency's name from its production files (#6124)

Importing `gno.land/p/demo/tokens/grc20` is a terminal rejection, and
the reason names a package the submitter never wrote.

Three packages in `examples/` are unimportable this way:
`p/demo/tokens/grc20` (named `grc20subrealm`), `p/demo/tokens/grc721`
(named `grc721dupsignal`), and `p/nt/treasury/v0` (named
`canonicaltest`). Counted across all 325 package directories with the
derivation the chain itself uses.

### A filetest sorts first and names the package

[`vm/qfile` serves a package's files
sorted](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/store.go#L1199),
and [`ReadMemPackage` flattens `filetests/` into that
list](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L821-L833),
so a filetest routinely arrives ahead of the production files.
[`packageName` took the first `.gno` file that
parsed](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/contribs/gpao/getter.go#L123-L134),
and filetests carry package clauses of their own.

```
caller_teller_sub_realm_filetest.gno   # package grc20subrealm   <- taken
gnomod.toml
token.gno                              # package grc20
token_test.gno                         # package grc20_test
```

The wrong name reaches the typechecker, which emits `.gnobuiltins.gno`
under it:

```
.gnobuiltins.gno:1:1: package grc20subrealm; expected package grc20
token.gno:3:14: undefined: address
token.gno:5:14: undefined: realm
```

`handleCandidate` then records `rejected` and marks the content hash
seen, so resubmitting identical bytes changes nothing.

### The chain already has the rule


[`ReadMemPackageFromList`](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L910)
derives a package's own name by skipping filetests, whose clauses ["may
have arbitrary package
names"](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L964),
and trimming a `_test` suffix. For a package holding only filetests it
[takes the filetests' clause where they agree and the literal
`"filetests"` where they do
not](https://github.com/gnolang/gno/blob/2ed70a202e6f92364be56c5c17ddd706e0c9d922/gnovm/pkg/gnolang/mempackage.go#L1008-L1014).
`packageName` now does the same.

An empty name was never a safe fallback: it leaves `.gnobuiltins.gno`
unparseable, and the verifier reports a panic rather than a diagnostic.

### Left alone

- Which files the typechecker considers is unchanged. The getter labels
the reconstructed package `MPUserProd`, which excludes tests and
filetests at typecheck.
- Which imports are fetched from the chain and which from disk is
unchanged. That is Q5 on #6113.

Other gpao defects and the design questions behind them: #6113.

🤖 Written with AI assistance (Claude); reviewed and submitted by a
human.

---------

Signed-off-by: Jeff Thompson <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Morgan <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Miguel Victoria Villaquiran <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>
Co-authored-by: Lee ByeongJun <[email protected]>
Co-authored-by: ltzmaxwell <[email protected]>
Co-authored-by: Jeff Thompson <[email protected]>
Co-authored-by: Jae Kwon <[email protected]>
Co-authored-by: Thomas <[email protected]>
Co-authored-by: davd-gzl <[email protected]>
Co-authored-by: jinoosss <[email protected]>
Co-authored-by: Antoine Eddi <[email protected]>
Co-authored-by: gfanton <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexis Colin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v0.38.x Tell Mergify to backport the PR to v0.38.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: De-duplicate writes in SaveABCIResponses / SaveFinalizeBlockResponse

5 participants