Documentation

Upgrade Path

The resolver can be replaced without migrating data. This section explains how to deploy a new resolver and migrate watchers with zero downtime.

Why Upgrade?

The resolver contains the validation logic — data decoding, permission checks, structural validation. If a bug is found or new logic is needed, a new resolver can be deployed while the registry (and all its data) remains untouched.

Migration Steps

  1. Deploy the new resolver contract, pointing to the same EnergyRegistry
  2. Authorize the new resolver in the registry: registry.authorizeResolver(newResolver)
  3. Register a new schema on EAS with the new resolver address
  4. Announce the new schema UID to watchers
  5. Watchers update their SCHEMA_UID environment variable and continue attesting
  6. Once all watchers have migrated, pause the old resolver: oldResolver.pause()
  7. Deauthorize the old resolver: registry.deauthorizeResolver(oldResolver)
Note

During migration, both resolvers are active simultaneously. Attestations through either schema UID are valid and recorded in the same registry. Revocations still work through the old resolver even after it is paused.

What Changes, What Stays

Changes:
  ✓ New resolver contract address
  ✓ New schema UID (registered with new resolver)
  ✓ Watchers update their SCHEMA_UID config

Does NOT change:
  ✗ Registry address
  ✗ Watcher IDs and ownership
  ✗ Project IDs and data
  ✗ Attester whitelists
  ✗ Energy accumulators
  ✗ Historical attestation data (in EAS)
  ✗ Period locks

Emergency Pause

The resolver owner can pause attestations at any time if a critical bug is discovered. Pausing only blocks new attestations — revocations continue to work, ensuring corrections can always be made.

Solidity
// Pause attestations (revocations still work)
resolver.pause()

// Resume attestations
resolver.unpause()