Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
303 stars 191 forks source link

When replacing priceFeeds, reset roundID in vstore #9597

Open Chris-Hibbert opened 4 days ago

Chris-Hibbert commented 4 days ago

What is the Problem Being Solved?

When priceFeed contracts are replaced, the new one starts writing to vstorage at the same node the old contract was writing to, but it doesn't start writing until it gets its first price data from an oracle. The new priceFeed contract expects roundIds to start from zero, but the oracles don't know that, and vstorage continues to hold the last value of roundId, startedAt and startedBy.

Description of the Design

Either reset the node contents to empty (if the oracles can handle that) or update the record with a roundId of 0.

Security Considerations

Not much impact on overall security

Scaling Considerations

Not an issue.

Test Plan

We need to coordinate with oracle providers to ensure we choose an approach that works with them.

Upgrade Considerations

See above.

mhofman commented 3 days ago

Discussed alternatives: