Skip to content

Conversation

@jstuczyn
Copy link
Contributor

@jstuczyn jstuczyn commented Jul 17, 2025

NET-443

this PR introduces a new CosmWasm smart contract, the "offline signers" contract. It's purpose is to allow ecash signers to agree on their view of what other signers might be unavailable and thus send a global signal to issue an 'emergency mode' to allow network usage without credentials (as they would be unissuable).

it's quite straightforward contract with very simple interface. operators can only either propose a singer to be marked as offline or mark itself as online.

A signer is marked as offline if a specified quorum (contract parameter) sends voting transaction to the contract. It is determined as a ratio of all CW4 (as set in the DKG contract) group members.

There's also a small cooldown period between being marked as online and offline to prevent constantly going between those two states.

Execute Messages

  • UpdateAdmin - self-explanatory call, updates current contract admin
  • ProposeOrVote - allows caller to propose or cast a vote on particular DKG signer being offline and not issuing credentials
  • ResetOfflineStatus - allows caller to reset its own offline status (i.e. after signer has been offline, this lets them announce to the world that they're back now)

Query Messages

  • Admin - Returns information on the current admin
  • GetConfig - Returns current config values of the contract
  • GetActiveProposal - Returns information of the current active proposal against specific signer
  • GetProposal - Returns information about proposal with the specified id
  • GetVoteInformation - Returns information on the vote from the provided voter for the specified proposal
  • GetOfflineSignerInformation - Returns offline signer information for the provided signer
  • GetOfflineSignersAddressesAtHeight - Returns list of addresses of all signers marked as offline at provided height.
  • GetLastStatusReset - Returns information on the last status reset of the provided signer
  • GetActiveProposalsPaged - Returns all (paged) active proposals
  • GetProposalsPaged - Returns all (paged) proposals
  • GetVotesPaged - Returns all (paged) votes for the specified proposal
  • GetOfflineSignersPaged - Returns all (paged) offline signers
  • GetLastStatusResetPaged - Returns all (paged) status resets
  • CurrentSigningStatus - Returns the current signing status, i.e. whether credential issuance is still possible
  • SigningStatusAtHeight - Returns the signing status at provided block height, i.e. whether credential issuance was possible at that point

This change is Reviewable

@vercel
Copy link

vercel bot commented Jul 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
nym-explorer-v2 Ready Ready Preview Comment Oct 6, 2025 9:56am
nym-node-status Ready Ready Preview Comment Oct 6, 2025 9:56am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-nextra Ignored Ignored Preview Oct 6, 2025 9:56am
nym-next-explorer Ignored Ignored Oct 6, 2025 9:56am

@jstuczyn jstuczyn force-pushed the feature/offline-signers-contract branch from 0f2be6a to 1917502 Compare July 18, 2025 08:57
@jstuczyn jstuczyn marked this pull request as ready for review July 21, 2025 14:17
@jstuczyn jstuczyn requested a review from durch as a code owner July 21, 2025 14:17
jstuczyn added a commit that referenced this pull request Jul 21, 2025
updated contract schema

remove duplicate import

queries tests

tx tests

ensure placeholder is deprecated so that clippy catches it

contract storage tests

ignore panics in legacy tests

missing performance contract schema changes

they weren't caught as the contract was missing from the makefile

dealing with CI

generated contract schema

client traits

query for exposing signing status at particular height

uses placeholder data due to another PR in progress at the time of writing

wip

removed placeholder mod

removed dead code

contract queries

resetting offline status of sender

implemented TestableNymContract for OfflineSigner, DKG, CW4 and CW3 contracts

basic logic for voting on offline signers

init offline signers contract
@jstuczyn jstuczyn force-pushed the feature/offline-signers-contract branch from b7d3ed5 to 7aae4d9 Compare July 21, 2025 14:20
jstuczyn added a commit that referenced this pull request Jul 22, 2025
updated contract schema

remove duplicate import

queries tests

tx tests

ensure placeholder is deprecated so that clippy catches it

contract storage tests

ignore panics in legacy tests

missing performance contract schema changes

they weren't caught as the contract was missing from the makefile

dealing with CI

generated contract schema

client traits

query for exposing signing status at particular height

uses placeholder data due to another PR in progress at the time of writing

wip

removed placeholder mod

removed dead code

contract queries

resetting offline status of sender

implemented TestableNymContract for OfflineSigner, DKG, CW4 and CW3 contracts

basic logic for voting on offline signers

init offline signers contract
@jstuczyn jstuczyn force-pushed the feature/offline-signers-contract branch from 7aae4d9 to 233b1f2 Compare July 22, 2025 08:36
@jstuczyn jstuczyn removed this from the Gruyere (est. mainnet 19.08.2025) milestone Aug 5, 2025
removed placeholder mod

updated contract schema

remove duplicate import

queries tests

tx tests

ensure placeholder is deprecated so that clippy catches it

contract storage tests

ignore panics in legacy tests

missing performance contract schema changes

they weren't caught as the contract was missing from the makefile

dealing with CI

generated contract schema

client traits

query for exposing signing status at particular height

uses placeholder data due to another PR in progress at the time of writing

wip

removed placeholder mod

removed dead code

contract queries

resetting offline status of sender

implemented TestableNymContract for OfflineSigner, DKG, CW4 and CW3 contracts

basic logic for voting on offline signers

init offline signers contract
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