Skip to content

Make params store readable so the batch state map mirror can be removed #43

Description

@notJoon

Suggested by @benluelo (Union team) when reporting the batch packets state map keying bug (fixed in #42).

Currently commit() (r/core/ibc/v1/core) writes commitments via params.SetBytes(hex(key), value), but the chain/params stdlib package (gno, gnovm/stdlibs/chain/params/params.gno) exposes no reader. As a result, r/core/ibc/v1/core/state.gno keeps an in-memory batchPackets / batchReceipts mirror just so relayers have something to query. The mirror duplicates the params store and must be kept consistent with it on every write/delete.

If the stdlib gains a params.GetBytes(key) ([]byte, bool) (or equivalent), the mirror maps can be deleted entirely, and QueryBatchPackets / QueryBatchReceipts (plus other Query* helpers) can read directly from params.

Scope

  • Upstream: add the reader API to chain/params in gno.
  • This repo: once available, drop State.batchPackets / State.batchReceipts, remove the mirror writes in saveBatchPackets / setBatchPackets / saveBatchReceipts / deletePacketCommitment / deletePacketReceipt, and re-point reads (getBatchPackets / getBatchReceipts / hasPacketCommitment / hasAcknowledgement / hasPacketReceipt / acknowledgementHash / Query*) at the new accessor.

Out of scope

  • Client / connection / channel state maps: those are keyed by small IDs and accessed only via dedicated Query* functions; removing them is a separate decision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ibcIBC core, light client, packet/channel/connectionP-highPriority: high — protocol violation or significant correctness gapT-refactorCode restructuring with no behavior change

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions