Skip to content

Proxy architecture for Enclave + registries Upgradeability #953

Description

@hmzakhalid

We need to make out contracts upgradeable, our contracts already have initialize() functions, which suggests they're meant to be upgradeable. But we're deploying them directly without proxy patterns.

This means every time we need to fix a bug or add a feature:

  1. We deploy new contract instances
  2. All the addresses change
  3. Every ciphernode operator has to update their enclave.config.yaml with new addresses
  4. Nodes go offline, have to restart, reconfigure, etc.
  5. It'll be a pain for testnet where we're iterating quickly

On testnet we're probably going to:

  • Fix bugs we discover
  • Add new features (like the refund mechanism)
  • Adjust parameters
  • Maybe add new storage variables

Each time we do this, if addresses change, we're asking all testnet operators to:

  1. Stop their nodes
  2. Update config files
  3. Restart nodes
  4. Hope they don't miss anything

That's... not ideal for rapid iteration.

We should use a proxy pattern (UUPS or Transparent Proxy) so proxy address stays constant, nodes configure once, never change, we can publish the contracts in our docs and forget about it.

Implementation can be upgraded, we deploy new implementations and point proxy to them, we can fix bugs without disrupting nodes

I'd say this is high priority for testnet. We're going to be iterating a lot, and having stable addresses will make the experience much smoother for operators.

Metadata

Metadata

Assignees

Labels

contractsRelated to the enclave-contracts package

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions