Skip to content

Conversation

@brenzi
Copy link
Collaborator

@brenzi brenzi commented Feb 19, 2025

closes #1598
closes #1259
closes #1115

  1. make use of L1 maintenance mode flag to filter incoming state transitions. This will allow Integritee Network governance to put a shard into maintenance mode, effectively pausing state transitions
  2. retire shard (force-unshield all user funds) if maintenance mode lasts for a "long" time. If maintenance mode isn't lifted within 30d on production systems, we assume the problem can't be solved and therefore recover user funds by unshielding all balances to L1 (to equal accounts). This does leak some sensitive information (account balances) but prevents loss of funds

effects of maintenance mode = true:

  • Getters still get executed.
  • Sidechain blocks still get produced
  • A new TrustedCall filter applies. Only shielding calls get through as we can't prevent them
  • After a hardcoded max duration of maintenance mode, the shard gets retired automatically

shard retirement:

  • for all accounts except some technical accounts (like enclave signer, fee collection aso.):
    • unshield_all assets and native tokens
  • do this for every block as long as we're running because shielding may happen (which should be immediately unshielded)

other changes:

  • make stf aware of its own shard & ShardConfig for additional checks
    • StorageVersion can be checked before attempting to decoded L1 mirrored storage
  • allow opaque L1 state mirroring to L2 and accessing it from stf (with examples for ShardConfig, ShardStatus, FinalizedSidechainBlock)
  • introduce new sgx-runtime pallet "shard-management" which shall serve to track fee payouts and maintenance mode stuff
  • introduce ShardMode with sticky Retired variant
  • new cli getter get-shard-info to query config, status and mode

followup tasks:

@brenzi brenzi changed the title Ab/maintenance mode maintenance mode Feb 20, 2025
@brenzi brenzi added A0-core Affects a core part A2-applibs Affects app-libs, i.e. runtime or stf B1-releasenotes C1-low 📌 Does not elevate a release containing this beyond "low priority" E0-breaksnothing labels Feb 23, 2025
@brenzi brenzi changed the title maintenance mode maintenance mode and shard retirement Feb 23, 2025
@brenzi brenzi requested a review from clangenb February 25, 2025 10:52
Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

LGTM

@brenzi
Copy link
Collaborator Author

brenzi commented Feb 26, 2025

tested successfully on Incognitee Paseo staging environment

@brenzi brenzi closed this Feb 26, 2025
@brenzi brenzi reopened this Feb 26, 2025
@brenzi brenzi merged commit 0710b37 into master Feb 26, 2025
93 of 94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-core Affects a core part A2-applibs Affects app-libs, i.e. runtime or stf B1-releasenotes C1-low 📌 Does not elevate a release containing this beyond "low priority" E0-breaksnothing

Projects

None yet

3 participants