Skip to content

orbis module extras#120

Merged
JesseAbram merged 15 commits into
devfrom
jesse/orbis-extras
Jun 30, 2026
Merged

orbis module extras#120
JesseAbram merged 15 commits into
devfrom
jesse/orbis-extras

Conversation

@JesseAbram

@JesseAbram JesseAbram commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This PR adds a reporting system to orbis so nodes can report on each other with a threshold signature and node demerit points are assigned and tracked based on that.

It also adds a way for a node to delete a pending ring

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e3cc719-45da-49a4-8318-08ac3ffd3f87

📥 Commits

Reviewing files that changed from the base of the PR and between d0b1863 and 8b46109.

⛔ Files ignored due to path filters (1)
  • x/orbis/types/genesis.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (14)
  • api/sourcehub/orbis/genesis.pulsar.go
  • app/app_config.go
  • proto/sourcehub/orbis/genesis.proto
  • x/orbis/keeper/endblock.go
  • x/orbis/keeper/msg_server.go
  • x/orbis/keeper/report_test.go
  • x/orbis/keeper/store.go
  • x/orbis/keeper/store_test.go
  • x/orbis/module/genesis.go
  • x/orbis/module/genesis_test.go
  • x/orbis/module/module.go
  • x/orbis/types/genesis.go
  • x/orbis/types/genesis_upgrade_test.go
  • x/orbis/types/keys.go
🚧 Files skipped from review as they are similar to previous changes (6)
  • x/orbis/module/genesis.go
  • x/orbis/types/genesis_upgrade_test.go
  • x/orbis/types/keys.go
  • x/orbis/module/genesis_test.go
  • x/orbis/keeper/msg_server.go
  • x/orbis/keeper/report_test.go
📜 Recent review details
⚠️ CI failures not shown inline (2)

GitHub Actions: .github/workflows/test.yml / 0_test.txt: add orbis to end block

Conclusion: failure

View job details

##[group]Run go test -coverpkg=all ./... -coverprofile=coverage.txt
 �[36;1mgo test -coverpkg=all ./... -coverprofile=coverage.txt�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 go: downloading cosmossdk.io/api v0.7.6
 go: downloading github.com/cosmos/cosmos-proto v1.0.0-beta.5
 go: downloading github.com/cosmos/gogoproto v1.7.2
 go: downloading github.com/sourcenetwork/acp_core v0.8.1
 go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516
 go: downloading google.golang.org/grpc v1.80.0
 go: downloading google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094
 go: downloading google.golang.org/protobuf v1.36.11
 go: downloading github.com/cosmos/cosmos-sdk v0.50.14
 go: downloading cosmossdk.io/math v1.5.0
 go: downloading github.com/skip-mev/block-sdk/v2 v2.1.5
 go: downloading cosmossdk.io/log v1.5.0
 go: downloading cosmossdk.io/store v1.1.1
 go: downloading github.com/cometbft/cometbft v0.38.21
 go: downloading github.com/cosmos/cosmos-db v1.1.3
 go: downloading github.com/stretchr/testify v1.11.1
 go: downloading github.com/hashicorp/go-metrics v0.5.3
 go: downloading github.com/TBD54566975/ssi-sdk v0.0.4-alpha
 go: downloading github.com/cosmos/ibc-go/v10 v10.1.1
 go: downloading cosmossdk.io/errors v1.0.1
 go: downloading cosmossdk.io/x/tx v0.13.7
 go: downloading github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
 go: downloading github.com/go-jose/go-jose/v3 v3.0.5
 go: downloading github.com/lestrrat-go/jwx/v2 v2.1.6
 go: downloading cosmossdk.io/client/v2 v2.0.0-beta.3
 go: downloading cosmossdk.io/core v0.11.1
 go: downloading cosmossdk.io/depinject v1.1.0
 go: downloading cosmossdk.io/tools/confix v0.1.2
 go: downloading github.com/golang/mock v1.6.0
 go: downloading github.com/spf13/cobra v1.10.1
 go: downloading github.com/spf13/pflag v1.0.10
 go: downloading github.com/spf13/viper v1.19.0
 go: downloading github.com/gorilla/mux v1.8.1
 go: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8...

GitHub Actions: .github/workflows/test.yml / test: add orbis to end block

Conclusion: failure

View job details

##[group]Run go test -coverpkg=all ./... -coverprofile=coverage.txt
 �[36;1mgo test -coverpkg=all ./... -coverprofile=coverage.txt�[0m
 shell: /usr/bin/bash -e {0}
 ##[endgroup]
 go: downloading cosmossdk.io/api v0.7.6
 go: downloading github.com/cosmos/cosmos-proto v1.0.0-beta.5
 go: downloading github.com/cosmos/gogoproto v1.7.2
 go: downloading github.com/sourcenetwork/acp_core v0.8.1
 go: downloading google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516
 go: downloading google.golang.org/grpc v1.80.0
 go: downloading google.golang.org/genproto v0.0.0-20240701130421-f6361c86f094
 go: downloading google.golang.org/protobuf v1.36.11
 go: downloading github.com/cosmos/cosmos-sdk v0.50.14
 go: downloading cosmossdk.io/math v1.5.0
 go: downloading github.com/skip-mev/block-sdk/v2 v2.1.5
 go: downloading cosmossdk.io/log v1.5.0
 go: downloading cosmossdk.io/store v1.1.1
 go: downloading github.com/cometbft/cometbft v0.38.21
 go: downloading github.com/cosmos/cosmos-db v1.1.3
 go: downloading github.com/stretchr/testify v1.11.1
 go: downloading github.com/hashicorp/go-metrics v0.5.3
 go: downloading github.com/TBD54566975/ssi-sdk v0.0.4-alpha
 go: downloading github.com/cosmos/ibc-go/v10 v10.1.1
 go: downloading cosmossdk.io/errors v1.0.1
 go: downloading cosmossdk.io/x/tx v0.13.7
 go: downloading github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
 go: downloading github.com/go-jose/go-jose/v3 v3.0.5
 go: downloading github.com/lestrrat-go/jwx/v2 v2.1.6
 go: downloading cosmossdk.io/client/v2 v2.0.0-beta.3
 go: downloading cosmossdk.io/core v0.11.1
 go: downloading cosmossdk.io/depinject v1.1.0
 go: downloading cosmossdk.io/tools/confix v0.1.2
 go: downloading github.com/golang/mock v1.6.0
 go: downloading github.com/spf13/cobra v1.10.1
 go: downloading github.com/spf13/pflag v1.0.10
 go: downloading github.com/spf13/viper v1.19.0
 go: downloading github.com/gorilla/mux v1.8.1
 go: downloading github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8...
🧰 Additional context used
🪛 ast-grep (0.44.0)
api/sourcehub/orbis/genesis.pulsar.go

[warning] 2264-2264: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: int32(wire >> 3)
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)

🪛 Buf (1.71.0)
proto/sourcehub/orbis/genesis.proto

[error] 41-41: cannot find gogoproto.nullable in this scope

(COMPILE)


[error] 42-42: cannot find amino.dont_omitempty in this scope

(COMPILE)

🔇 Additional comments (10)
api/sourcehub/orbis/genesis.pulsar.go (1)

272-322: LGTM!

Also applies to: 441-452, 478-481, 508-511, 555-566, 605-612, 662-673, 702-707, 805-816, 846-877, 1177-1244, 1280-2601, 2619-2619, 2642-2680, 2695-2718, 2744-2775

proto/sourcehub/orbis/genesis.proto (2)

40-43: Verify Buf configuration for gogoproto and amino imports.

Buf reports errors finding gogoproto.nullable and amino.dont_omitempty at lines 41-42, yet the same annotations on earlier fields compile without issue. Confirm that:

  1. import "gogo.proto" and import "amino.proto" are present at the top of this file.
  2. buf.yaml includes the proper proto paths or buf.build deps for gogoproto and amino.

These annotations are standard in Cosmos SDK projects; the errors likely indicate a Buf workspace configuration gap rather than a schema defect.


36-43: 🗄️ Data Integrity & Integration

Confirm field renumbering of accepted_report_pairs does not break genesis compatibility.

accepted_report_pairs was moved from tag 6 to tag 7, with the new node_demerits field taking tag 6. If accepted_report_pairs existed in any prior release or exported genesis state, this renumbering will:

  • Corrupt existing genesis exports (tag 6 data will be parsed as NodeDemeritEntry instead of AcceptedReportPairEntry)
  • Break wire compatibility with any running nodes

Verify whether accepted_report_pairs existed in a previous commit. If it did, do not renumber — use the next available tag (8) for node_demerits instead, or reserve tag 6 as reserved 6 to prevent accidental reuse.

x/orbis/types/genesis.go (2)

23-43: The unknown-ring rejection from the prior review is now in place; demerits referencing rings absent from gs.Rings are correctly rejected before persistence.


55-76: LGTM!

x/orbis/keeper/endblock.go (1)

9-14: LGTM!

app/app_config.go (1)

176-176: LGTM!

x/orbis/keeper/store_test.go (1)

42-73: LGTM!

x/orbis/module/module.go (1)

35-36: LGTM!

Also applies to: 111-113

x/orbis/keeper/store.go (1)

44-129: LGTM!


📝 Walkthrough

Walkthrough

Adds report submission, node demerit tracking and querying, ring lifecycle outcome changes, demerit configuration support, and matching protobuf, genesis, CLI, and test updates.

Changes

Orbis report, demerit, and ring lifecycle changes

Layer / File(s) Summary
Proto schema changes
proto/sourcehub/orbis/*.proto
Defines DemeritConfig, adds it to Ring and Params, makes pss_interval required, adds EventReportAccepted, CancelPendingRing, SubmitReport, ReportEnvelope, NodeDemerits, and genesis node demerit state.
Types, keys, and validation helpers
x/orbis/types/*.go
Adds minimum PSS validation, demerit config defaults and validation, ring ID hashing changes, new store key prefixes, updated sentinel errors, new message constructors and ValidateBasic logic, and interface registration updates.
Keeper storage, report validation, and msg/query handlers
x/orbis/keeper/*.go, x/orbis/module/genesis.go, x/orbis/module/autocli.go, app/app_config.go
Adds accepted-report and node-demerit storage, canonical report validation and demerit calculation, SubmitReport, CancelPendingRing, FinalizeRing outcome handling, NodeDemerits, ring validation updates, genesis import/export wiring, end-block expiry cleanup, and CLI descriptor changes.
Generated protobuf bindings
api/sourcehub/orbis/*.pulsar.go
Regenerates fast-protobuf reflection, marshal/unmarshal logic, and registration metadata for EventReportAccepted, Params.DefaultDemeritConfig, QueryNodeDemeritsRequest/QueryNodeDemeritsResponse, and NodeDemeritEntry genesis bindings.
Tests
x/orbis/keeper/*_test.go, x/orbis/types/*_test.go, x/orbis/module/genesis_test.go, testutil/network/network.go
Adds canonical report and demerit tests, CancelPendingRing and FinalizeRing outcome coverage, ring creation and mutation updates for PssInterval and DemeritConfig, genesis round-trip coverage, and validation tests for PSS intervals and demerit config.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant MsgServer
  participant validateSubmittedReport
  participant KeeperStore
  participant ThresholdSig
  Client->>MsgServer: MsgSubmitReport
  MsgServer->>validateSubmittedReport: envelope + block context
  validateSubmittedReport->>KeeperStore: HasAcceptedReport (replay check)
  validateSubmittedReport->>KeeperStore: GetRing (ring existence + PK + digest)
  validateSubmittedReport->>ThresholdSig: verifyThresholdSignature (BLS/FROST)
  ThresholdSig-->>validateSubmittedReport: ok / error
  validateSubmittedReport-->>MsgServer: validated report bundle
  MsgServer->>KeeperStore: SetAcceptedReport
  MsgServer->>KeeperStore: IncrementNodeDemerits
  MsgServer-->>Client: MsgSubmitReportResponse
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

Suggested reviewers

  • jsimnz
  • Lodek
  • iverc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.91968% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.30%. Comparing base (d870cb0) to head (8b46109).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
x/orbis/keeper/report.go 73.50% 58 Missing and 35 partials ⚠️
x/orbis/types/genesis.go 67.34% 14 Missing and 2 partials ⚠️
x/orbis/types/message_submit_report.go 43.47% 10 Missing and 3 partials ⚠️
x/orbis/keeper/msg_server.go 86.36% 6 Missing and 6 partials ⚠️
x/orbis/keeper/store.go 92.30% 6 Missing and 5 partials ⚠️
x/orbis/keeper/grpc_query.go 87.50% 1 Missing and 1 partial ⚠️
x/orbis/types/message_create_ring.go 71.42% 2 Missing ⚠️
x/orbis/keeper/params.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #120      +/-   ##
==========================================
+ Coverage   49.20%   51.30%   +2.09%     
==========================================
  Files         302      317      +15     
  Lines       17525    18491     +966     
==========================================
+ Hits         8623     9486     +863     
+ Misses       8010     8004       -6     
- Partials      892     1001     +109     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

// These integration tests only use validator 0. Keeping the default network
// single-validator also avoids a CometBFT v0.38.21 shutdown race where a
// peer-reactor goroutine can access the block store after it has been closed.
cfg.NumValidators = 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

double check this should not effect anything prod, just on the testing this should fix the flakey faucet tests

JesseAbram and others added 2 commits June 18, 2026 15:10
* Add reporting

* clean

* add settable demerits

* add querys

* window demerit reset

* proto

* more tests

* node demerits rpc change

* coderabbit
@JesseAbram JesseAbram marked this pull request as ready for review June 29, 2026 14:48

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@x/orbis/keeper/msg_server.go`:
- Around line 136-145: The ring-deletion flow in MsgFinalizeRing/MsgCreateRing
only removes the Orbis KV record via DeleteRing, but it leaves the ACP
registration behind, so reusing the same deterministic ring ID can fail. Update
the ring cleanup path to also unregister or delete the corresponding
types.ACPResourceRing from ACP whenever a ring is deleted, and apply the same
cleanup in both conflict-delete branches so repeated create attempts can
succeed.

In `@x/orbis/keeper/report.go`:
- Around line 117-124: The protocol-version validation in report processing is
using the submit block time instead of the report’s observed time, which can
incorrectly reject still-valid reports. Update the effective version check in
the report handling path to base `effectiveReportProtocolVersion` on
`payload.ObservedAt` (or the report’s observed timestamp) rather than `now`, and
keep the existing `payload.originProtocolVersion` comparison and error path in
`report.go` unchanged otherwise.

In `@x/orbis/keeper/validation.go`:
- Around line 35-37: validateRing currently checks demerit config but never
enforces the new PSS interval invariant, so add the new helper call there as
well. Update validateRing in validation.go to invoke the PSS interval validation
helper alongside types.ValidateDemeritConfig, ensuring any persisted types.Ring
is rejected when pss_interval is below MinPSSIntervalSeconds. Keep the fix
localized to validateRing and the new helper introduced near the PSS validation
logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a2b6def-e464-4e70-8179-9d8898e3a155

📥 Commits

Reviewing files that changed from the base of the PR and between 1206e0c and fb49099.

⛔ Files ignored due to path filters (10)
  • api/sourcehub/orbis/query_grpc.pb.go is excluded by !**/*.pb.go
  • api/sourcehub/orbis/ring.pb.go is excluded by !**/*.pb.go
  • api/sourcehub/orbis/tx.pb.go is excluded by !**/*.pb.go
  • api/sourcehub/orbis/tx_grpc.pb.go is excluded by !**/*.pb.go
  • x/orbis/types/events.pb.go is excluded by !**/*.pb.go
  • x/orbis/types/params.pb.go is excluded by !**/*.pb.go
  • x/orbis/types/query.pb.go is excluded by !**/*.pb.go
  • x/orbis/types/query.pb.gw.go is excluded by !**/*.pb.gw.go
  • x/orbis/types/ring.pb.go is excluded by !**/*.pb.go
  • x/orbis/types/tx.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (39)
  • api/sourcehub/orbis/events.pulsar.go
  • api/sourcehub/orbis/params.pulsar.go
  • api/sourcehub/orbis/query.pulsar.go
  • proto/sourcehub/orbis/events.proto
  • proto/sourcehub/orbis/params.proto
  • proto/sourcehub/orbis/query.proto
  • proto/sourcehub/orbis/ring.proto
  • proto/sourcehub/orbis/tx.proto
  • testutil/network/network.go
  • x/orbis/keeper/demerits.go
  • x/orbis/keeper/grpc_query.go
  • x/orbis/keeper/msg_server.go
  • x/orbis/keeper/msg_server_baseapp_test.go
  • x/orbis/keeper/msg_server_cancel_pending_ring_test.go
  • x/orbis/keeper/msg_server_reshare_sig_test.go
  • x/orbis/keeper/msg_server_test.go
  • x/orbis/keeper/optional.go
  • x/orbis/keeper/params.go
  • x/orbis/keeper/report.go
  • x/orbis/keeper/report_test.go
  • x/orbis/keeper/reshare_sign_bytes_test.go
  • x/orbis/keeper/ring_upgrade_test.go
  • x/orbis/keeper/store.go
  • x/orbis/keeper/store_test.go
  • x/orbis/keeper/validation.go
  • x/orbis/keeper/validation_test.go
  • x/orbis/module/autocli.go
  • x/orbis/types/codec.go
  • x/orbis/types/errors.go
  • x/orbis/types/genesis_upgrade_test.go
  • x/orbis/types/keys.go
  • x/orbis/types/keys_test.go
  • x/orbis/types/message_cancel_pending_ring.go
  • x/orbis/types/message_create_ring.go
  • x/orbis/types/message_mutations_test.go
  • x/orbis/types/message_set_ring_pss_interval_by_acp.go
  • x/orbis/types/message_submit_report.go
  • x/orbis/types/params.go
  • x/orbis/types/pss.go
💤 Files with no reviewable changes (1)
  • x/orbis/keeper/optional.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: test
🧰 Additional context used
🪛 ast-grep (0.44.0)
api/sourcehub/orbis/query.pulsar.go

[warning] 7629-7629: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: int32(wire >> 3)
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)


[warning] 8078-8078: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: int32(wire >> 3)
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)

x/orbis/keeper/report.go

[warning] 423-423: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(value))
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)


[warning] 436-436: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(values))
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)

x/orbis/keeper/store.go

[warning] 115-115: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(ringID))
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)

api/sourcehub/orbis/events.pulsar.go

[warning] 5470-5470: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: int32(wire >> 3)
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)

🪛 Buf (1.71.0)
proto/sourcehub/orbis/params.proto

[error] 6-6: imported file does not exist

(COMPILE)


[error] 12-12: cannot find amino.name in this scope

(COMPILE)


[error] 13-13: cannot find gogoproto.equal in this scope

(COMPILE)


[error] 15-15: cannot find DemeritConfig in this scope

(COMPILE)


[error] 15-15: cannot find gogoproto.nullable in this scope

(COMPILE)

proto/sourcehub/orbis/query.proto

[error] 61-61: cannot find google.api.http in this scope

(COMPILE)

proto/sourcehub/orbis/ring.proto

[error] 18-18: cannot find gogoproto.equal in this scope

(COMPILE)


[error] 39-39: cannot find gogoproto.nullable in this scope

(COMPILE)


[error] 40-40: cannot find gogoproto.nullable in this scope

(COMPILE)

proto/sourcehub/orbis/tx.proto

[error] 10-10: imported file does not exist

(COMPILE)


[error] 65-65: cannot find DemeritConfig in this scope

(COMPILE)


[error] 91-91: cannot find cosmos.msg.v1.signer in this scope

(COMPILE)


[error] 149-149: cannot find cosmos.msg.v1.signer in this scope

(COMPILE)


[error] 151-151: cannot find gogoproto.nullable in this scope

(COMPILE)

🔇 Additional comments (38)
x/orbis/keeper/store.go (1)

43-53: LGTM!

Also applies to: 55-121

x/orbis/keeper/store_test.go (1)

42-101: LGTM!

x/orbis/keeper/grpc_query.go (1)

8-8: LGTM!

Also applies to: 131-153

x/orbis/keeper/report.go (1)

1-116: LGTM!

Also applies to: 127-550

x/orbis/keeper/demerits.go (1)

1-21: LGTM!

x/orbis/keeper/msg_server.go (1)

45-70: LGTM!

Also applies to: 156-158, 182-214, 220-223, 326-335, 516-561

x/orbis/keeper/params.go (1)

12-20: LGTM!

Also applies to: 24-37

x/orbis/module/autocli.go (1)

51-74: LGTM!

Also applies to: 107-112

x/orbis/keeper/report_test.go (1)

27-693: LGTM!

x/orbis/keeper/msg_server_baseapp_test.go (1)

87-127: 🎯 Functional Correctness

Re-read state from a fresh BaseApp context after SimDeliver.

ctx is created before delivery and then reused for the post-tx GetRing assertion. With BaseApp, that can end up asserting against a pre-delivery snapshot rather than the tx result. Please verify the SDK semantics here and consider creating a fresh context for the post-SimDeliver reads.

Also applies to: 200-231

x/orbis/keeper/msg_server_cancel_pending_ring_test.go (1)

15-189: LGTM!

x/orbis/keeper/validation_test.go (1)

11-28: 🎯 Functional Correctness

Verify this doesn't leave a validateRing bypass for the new minimum PSS interval.

This test locks in that validateRing accepts pss_interval = 0 and values below types.MinPSSIntervalSeconds. If any create/import/mutation path still calls validateRing without validateRingPSSInterval, the new minimum remains bypassable.

testutil/network/network.go (1)

102-105: 📐 Maintainability & Code Quality

Please confirm no callers still rely on the default multi-validator topology.

DefaultConfigWithOptions now forces every consumer onto a single-validator network. That removes consensus/peer-path coverage unless callers explicitly override cfg.NumValidators afterward, so it's worth verifying this helper is only used by tests that intentionally target validator 0.

x/orbis/types/genesis_upgrade_test.go (1)

10-37: LGTM!

x/orbis/types/message_mutations_test.go (1)

12-48: LGTM!

Also applies to: 50-79, 91-91, 103-106, 120-132

x/orbis/keeper/msg_server_test.go (1)

66-84: LGTM!

Also applies to: 111-111, 176-278, 279-323, 340-352, 362-368, 375-386, 395-406, 415-426, 437-470, 494-500, 522-528, 551-585, 587-623, 625-655, 657-673, 709-721, 744-763, 766-823, 825-842, 881-897, 915-935, 960-975, 1010-1022, 1050-1067, 1090-1109, 1130-1152, 1180-1232, 1240-1286, 1289-1310, 1355-1368

x/orbis/keeper/msg_server_reshare_sig_test.go (1)

37-43: LGTM!

Also applies to: 123-129

x/orbis/keeper/reshare_sign_bytes_test.go (1)

25-28: LGTM!

Also applies to: 40-43, 60-63, 75-78

x/orbis/keeper/ring_upgrade_test.go (1)

43-43: LGTM!

Also applies to: 119-119, 129-129, 207-207, 234-255, 368-386

x/orbis/types/keys_test.go (1)

14-15: LGTM!

x/orbis/types/params.go (1)

21-37: LGTM!

Also applies to: 47-57

proto/sourcehub/orbis/tx.proto (1)

10-10: 🎯 Functional Correctness

No unresolved proto symbols here. sourcehub/orbis/ring.proto exists, and DemeritConfig, cosmos.msg.v1.signer, and gogoproto.nullable are all already in scope.

			> Likely an incorrect or invalid review comment.
proto/sourcehub/orbis/params.proto (1)

6-15: 🎯 Functional Correctness

Drop this concern. sourcehub/orbis/ring.proto exists, defines DemeritConfig, and params.proto already imports the amino and gogoproto options needed here.

			> Likely an incorrect or invalid review comment.
proto/sourcehub/orbis/ring.proto (1)

16-21: 🎯 Functional Correctness

No issue here — gogoproto is already imported. proto/sourcehub/orbis/ring.proto includes import "gogoproto/gogo.proto";, so (gogoproto.equal) and (gogoproto.nullable) resolve.

			> Likely an incorrect or invalid review comment.
api/sourcehub/orbis/params.pulsar.go (1)

148-152: 🩺 Stability & Availability

Remove the nil-guard suggestion. default_demerit_config is a protobuf message field, and (*DemeritConfig).ProtoReflect() already handles a nil receiver, so this Get() path does not panic on an unset field.

			> Likely an incorrect or invalid review comment.
proto/sourcehub/orbis/events.proto (1)

71-78: LGTM!

proto/sourcehub/orbis/query.proto (2)

144-151: LGTM!


59-62: 🎯 Functional Correctness

No action needed here. proto/sourcehub/orbis/query.proto already imports google/api/annotations.proto, and buf.yaml includes buf.build/googleapis/googleapis, so google.api.http is in scope.

			> Likely an incorrect or invalid review comment.
x/orbis/types/pss.go (1)

5-12: LGTM!

x/orbis/types/keys.go (1)

19-24: LGTM!

Also applies to: 37-46

x/orbis/types/message_set_ring_pss_interval_by_acp.go (1)

18-19: LGTM!

x/orbis/types/errors.go (1)

31-43: 🗄️ Data Integrity & Integration

No error-code renumbering here. These additions use fresh codes (1238-1240), and the surrounding registrations remain stable.

			> Likely an incorrect or invalid review comment.
x/orbis/types/message_cancel_pending_ring.go (1)

9-19: LGTM!

x/orbis/types/message_create_ring.go (1)

11-19: LGTM!

Also applies to: 35-42

x/orbis/types/message_submit_report.go (1)

9-50: LGTM!

x/orbis/types/codec.go (1)

14-20: LGTM!

api/sourcehub/orbis/events.pulsar.go (1)

4999-5674: LGTM!

Also applies to: 6160-6227, 6299-6322, 6337-6337, 6349-6349, 6485-6504

api/sourcehub/orbis/query.pulsar.go (1)

7254-7737: LGTM!

Also applies to: 7738-8141, 8732-8809, 8920-9024, 9039-9101, 9310-9341

Comment thread x/orbis/keeper/msg_server.go
Comment thread x/orbis/keeper/report.go Outdated
Comment thread x/orbis/keeper/validation.go
@JesseAbram JesseAbram requested a review from iverc June 29, 2026 15:27

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

I think we need to add genesis fields for demerits (genesis.go). a round-trip test for import/export would be nice too.

Comment thread x/orbis/keeper/report.go
if claimedReportID != reportID {
return nil, errorsmod.Wrap(types.ErrInvalidReport, "report_id does not match canonical report bytes")
}
if k.HasAcceptedReport(goCtx, reportID) {

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.

nit: I think it could be more efficient to check/dedupe it per ring/node/type/time so one outage only counts once

@JesseAbram JesseAbram Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good find, I like this idea, I chose to solve it on the orbis side mainly as orbis should drive a lot of the security here. This is done by having a session id, a session id is created on every request so only one report per session stop duplicate sessions. The idea is there is one reason a session could fail, that creates a report. This also allows an extra check on the orbis side like hey this session failed a report request should be coming in, which I like

Comment thread x/orbis/keeper/report.go
return err
}

if signingCommittee.threshold < 2 {

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.

nit: please add more tests around this logic

Comment thread x/orbis/keeper/store.go Outdated
store.Delete([]byte(ringID))
}

func (k *Keeper) SetAcceptedReport(ctx context.Context, reportID string) {

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.

I think we should expire these in EndBlock after 120s

return nil, types.ErrInvalidRingCanceller
}

k.DeleteRing(goCtx, ring.Id)

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.

rings are hard deleted but acp objects are not, should we archive instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So my concern is that an acp policy can be used in multiple rings, so if a ring was deleted and the policy archived it would brick other rings?

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

Left a few comments, mostly nits, except for the genesis.go import/export one. LGTM otherwise 👍

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@x/orbis/types/genesis.go`:
- Around line 22-44: Add validation in the genesis checking logic that verifies
every NodeDemerits entry references an existing ring. In the validation loop in
genesis.go, build a set of Ring IDs from gs.Rings first, then reject any entry
whose RingId is not present before proceeding with the existing empty-field,
points, and duplicate checks. Keep the fix localized to the genesis validation
path so InitGenesis only ever persists demerits for known rings.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0bbbba87-e555-4803-8960-20ec0bad352b

📥 Commits

Reviewing files that changed from the base of the PR and between 4ca810d and f7493c4.

⛔ Files ignored due to path filters (1)
  • x/orbis/types/genesis.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (7)
  • api/sourcehub/orbis/genesis.pulsar.go
  • proto/sourcehub/orbis/genesis.proto
  • x/orbis/keeper/store.go
  • x/orbis/module/genesis.go
  • x/orbis/module/genesis_test.go
  • x/orbis/types/genesis.go
  • x/orbis/types/genesis_upgrade_test.go
📜 Review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: test
🧰 Additional context used
🪛 ast-grep (0.44.0)
api/sourcehub/orbis/genesis.pulsar.go

[warning] 1575-1575: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: int32(wire >> 3)
Note: [CWE-190] Integer Overflow or Wraparound.

(integer-overflow-narrowing-conversion-go)

🪛 Buf (1.71.0)
proto/sourcehub/orbis/genesis.proto

[error] 37-37: cannot find gogoproto.nullable in this scope

(COMPILE)


[error] 38-38: cannot find amino.dont_omitempty in this scope

(COMPILE)

🔇 Additional comments (2)
api/sourcehub/orbis/genesis.pulsar.go (1)

221-2029: LGTM!

proto/sourcehub/orbis/genesis.proto (1)

36-38: 🎯 Functional Correctness

Check the node_demerits field options

Ensure gogoproto.nullable and amino.dont_omitempty are imported and resolve for proto/sourcehub/orbis/genesis.proto, or drop them from node_demerits if they are not meant to be used.

Comment thread x/orbis/types/genesis.go
@JesseAbram JesseAbram requested a review from iverc June 30, 2026 16:23
@JesseAbram JesseAbram merged commit b291045 into dev Jun 30, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants