Agoric Upcoming Platform Upgrade Introduction

BLDer Community,

We emerge from the code mines for an update on the progress that Agoric OpCo has put into platform development, and an introduction of the next platform upgrade!

It’s been a ridiculously busy 2023 as we’ve furiously built out platform features to get the chain ready to host complex protocols, starting with the expected Inter Protocol Vaults Release but soon expanding to third party applications. So without further ado, here’s a high level overview of the core features included in the platform upgrade.

More detail will follow in future posts as well as in documentation.

Validator State Sync
Need to sync your node up to the chain? No time for a Snickers anymore - it’s super fast now! Many thanks to the Validator community in testing the code and providing excellent feedback. Stay tuned for a detailed post specifically on State Sync.

Contract Upgrade
Developers need to be able to define when and how their contracts will upgrade in place without killing the previous contract and its precious state. Significant work went into upgrading the smart contract platform to allow contracts to survive upgrade, and contracts - including the Parity Stability Module - were enhanced to take advantage of this capability.

Governance Capability Upgrades
New JavaScript governance capabilities were added to Agoric smart contracts to allow electorates to call functions on a contract. This will allow the Economic Committee to perform their duty as their scope expands with the Vaults release, and is available to new governance entities built by anyone in the community.

Critical Message Prioritization
Transactions from critical chain actors such as oracle nodes and Economic Committee members can be prioritized to ensure proper chain functioning even under heavy load.

Scalability and Performance
Significant performance improvements identified and addressed across the Agoric Virtual Machine which will lead to better performance for deployed contracts and lower storage costs for validators.

Note that the expected Inter Protocol Vaults expansion is also an important aspect of the overall chain upgrade. Expect a separate thread soon which will outline core Vaults components available in testnet for community evaluation.


Scalability and Performance

The Agoric OpCo engineering team engaged in scenario based performance optimization.

  • When we began creating a single vault took on average 900ms
  • When we finished creating a single vault took on average 300ms

Primarily we focused on platform level improvements - which will help to speed up not just vaults transactions but most contract transactions:

  • Performance optimizing Hardened Javascript:
    • Moving to a native implementation of harden() within the XS engine for contracts vs. using a Javascript implementation
    • Moving to a no-op version of harden() within the intra-kernel security boundary. There is enough trust within the kernel to remove our prior use of harden() .
    • Adopting updated version of endo/endojs which has a variety of performance improvements
  • Memory management
    • Properly applied virtualization to the on chain contracts. This reduces the overall memory usage of contracts and improves the performance on XS memory management
  • Optimizing performance on kernel error paths including optimizing use of assert() and Fail
  • Adopting an updated version of XS engine which has a variety of performance improvements

Critical Message Prioritization

The Critical Message Prioritization enables priority processing of important signed Cosmos transactions within the Agoric VM based on their source address and/or transaction message type. This helps ensure that when the Agoric chain is busy, critical messages like oracle price updates or changes to governance parameters aren’t slowed down.

Currently, incoming transactions delivered by the Cosmos SDK are queued in the Agoric VM’s inbound queue. The Agoric VM dequeues and processes these transactions in a first-in-first-out (FIFO) manner.
To facilitate critical message processing, the upcoming Mainnet-1B upgrade introduces a new high priority inbound queue into the Agoric VM. With this enhancement, the Agoric VM executes all transactions from the high priority inbound queue, then transactions from the regular inbound queue.

Because high priority transactions are received relatively infrequently, critical message prioritization is unlikely to introduce any meaningful delay in the execution of normal priority transactions, while enabling robust support for chain governance and economic stability.