Build on Agoric
Upgrading Contract and Exo Objects
Long-Lived Upgradable Objects in Agoric
Understanding Exos (Exposed Objects)
An Exo in Agoric is an exposed, remotable object that persists across contract upgrades. Think of it like a permanent employee in a company - they maintain their role and knowledge even when company policies change. Exos use InterfaceGuard for protection.
What Makes an Exo Special?
- Durability: Survives contract upgrades
- Remote Accessibility: Can be accessed from other parts of the system
- State Persistence: Maintains its state across upgrades
- Interface Guarantees: Provides consistent API access
Interface Guard Protection
- Acts as a protective layer around Exo objects
- Validates method calls and arguments
- Ensures only allowed operations are performed
- Maintains security during upgrades
Durability Through Zones
Zone Capabilities
- Provides API for creating Exo objects
- Manages object collections (Stores)
- Supports different persistence types:
- Ephemeral (JS heap)
- Virtual (disk storage)
- Durable (upgrade survival)
Baggage System
- Preserves state during upgrades
- Acts like a secure container for contract data
- Ensures continuity of operations
- Maintains object relationships
Upgrade Process
Preparation
- Define what state needs to be preserved
- Plan new features or modifications
- Ensure backward compatibility
Implementation
- Create new contract version
- Define state transitions
- Update interfaces as needed
Comments
You need to enroll in the course to be able to comment!