Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

priceAggregator, scaledPriceAuthority contracts are already installed #7

Closed
dckc opened this issue Aug 3, 2023 · 6 comments · Fixed by #25
Closed

priceAggregator, scaledPriceAuthority contracts are already installed #7

dckc opened this issue Aug 3, 2023 · 6 comments · Fixed by #25

Comments

@dckc
Copy link
Collaborator

dckc commented Aug 3, 2023

priceAggregatorRef: {
bundleID: "b1-5e23d485ee30dadc1cc78c4df6009466e710bf53d63204f99da96decc50a2997d6afc25df3c0a479e41c7ff46aaa806eb0aaf94c9509c9f4860640ce8b271774",

The installation is already available as { ... installation: { consume { priceAggregator } } }.

We should be able to take this part of price-feed-proposal.js out:

  installations: {
    // ??? will every eval of price-feed-proposal install priceAggregator ?
    priceAggregator: restoreRef(priceFeedOptions.priceAggregatorRef),
  },

likewise in addAssetToVault.js:

    installations: {
      scaledPriceAuthority: restoreRef(scaledPriceAuthorityRef),
    },
@dckc
Copy link
Collaborator Author

dckc commented Oct 12, 2023

This has substantial impact on the cost (in IST) of deploying. Let's see if we can reduce that 10k IST estimate substantially.

I have a list of mainnet1B-bundle-ids.md that are already on chain. I guess you should have the same info in a devnet node.

When you have deployed recently, what's the size of the bundles that needed to go on chain?
Do you have tx ids handy?

cc @otoole-brendan @rowgraus

@dckc
Copy link
Collaborator Author

dckc commented Oct 12, 2023

revised estimate: 4761.172 IST (pending confirmation of bundle hashes)

since we can exclude scaledPriceAuthority and fluxAggregator

cost (IST) bundle entry tx hash
1924.306 {"compartment":"@agoric/inter-protocol-v0.16.1","module":"./src/proposals/price-feed-proposal.js"} 7E399842D6D84BF3AF2EE06B1123E3AFDD7BFCA57DC2F613D6CE8D02FA4D28D5
2676.186 {"compartment":"@agoric/inter-protocol-v0.16.1","module":"./src/price/fluxAggregatorContract.js"} 372516A73184B341BD50C7D31541942984841BCA8ECB6B102F47DF2962817109
2246.226 {"compartment":"@agoric/zoe-v0.26.2","module":"./src/contracts/scaledPriceAuthority.js"} 0FABE0DE0C0C11FAA449F479646F3887F997664D3AD699E894AA5743A0991FE7
2836.866 {"compartment":"@agoric/inter-protocol-v0.16.1","module":"./src/proposals/addAssetToVault.js"} B98BC6AB60644A179542C9CEC593A6900D4A7A801149FCB8A83AC10F8B65AAF2

@dckc
Copy link
Collaborator Author

dckc commented Oct 13, 2023

fluxAggregator contract bundle changed between stATOM2 and stATOM3

perhaps due to...

cc @turadg

Neither is the same bundle as any on mainnet.
mainnet1B-bundle-ids.md

We really should tweak the proposal so it uses the already-installed fluxAggregator contract installation (called priceAggregator in agoricNames.installation).

cost (IST) bundle entry bundle hash time tx hash
2677.362 {"compartment":"@agoric/inter-protocol-v0.16.1","module":"./src/price/fluxAggregatorContract.js"} a190115d105bd5d7041f2981a89e9a9294c57ecd5706772a75839a65d70a530ace7a3670234e486fed05a03d84749034e77bdafcbd6f357d2770788397fd7fc8 2023-10-12 16:35:57 EFC9A23E130775530A5DFC6A8D08CFF26F2DD0E4E65E161CA04508C2EE1F1016

stATOM3 bundles on an explorer

https://devnet.agoric.explorers.guru/account/agoric15xddzse9lq74cyt6ev9d7wywxerenxdgxsdc3m is handy:

image

@dckc
Copy link
Collaborator Author

dckc commented Oct 13, 2023

agoricdev-23 contract bundles don't match mainnet

ugh... starting devnet on agoric-upgrade-11 (Sep 5) doesn't actually match mainnet. mainnet started on mainnet1B-rc3 (Jun 9) and upgraded to -11.

In particular, the fluxAggregator bundle is from 1B

priceAggregator contract hash on agoricdev-23 doesn't match any in mainnet1B-bundle-ids.md

From ps, we get b1-18d59 from v30:zcf-b1-18d59-ATOM-USD_price_feed, which we can match with the bundles table in the kernel swingstore:

root@validator-0:/state# ps ax | grep -e '-ATOM-USD_price_feed '
 353402 ?        S      0:01 /usr/src/agoric-sdk/packages/xsnap/xsnap-native/xsnap/build/bin/lin/release/xsnap-worker v30:zcf-b1-18d59-ATOM-USD_price_feed -r @8:v30-5660
root@validator-0:/state# sqlite3 agoricdev-23/data/agoric/swingstore.sqlite '.mode column' '.header on' "select bundleId from bundles where bundleId like 'b1-18d59%'"
bundleID                                                                                                                           
-----------------------------------------------------------------------------------------------------------------------------------
b1-18d599100b4a9f65827bc1a0bddbe3532e8061220074961587677d04a6f52abacb7c87a6b552102539b630af4184705cfb34b56e23de718e99d17591aeb87e40

@dckc
Copy link
Collaborator Author

dckc commented Oct 13, 2023

Mainnet fluxAggregator: b1-4522b... scaledPriceAuthority: b1-0b217...

I was able to build bundles from mainnet1B-rc3 that matches a hash in mainnet1B-bundle-ids.md:

  bundle file bundle hash date   release git hash
  inter-protocol/bundles/bundle-fluxAggregatorKit.js 4522bd0b71b615b612235d321977a1e906cd289e0962b106e7ba5718d0e94e25bc2c9e4be589c513c05c337c25a0c89c527b91322415cc80337fb2b2b0ccb75a 2023-06-09   mainnet1B-rc3 ba3b77644
  inter-protocol/bundles/bundle-scaledPriceAuthority.js 0b2177975e88c7221b2fe635fdc75f518916ee42d959e9772dc77ef9775995f36cef50578a070708606e2c2431e66ee51d01147b10821aa5f1983e564697cccd 2023-06-09   mainnet1B-rc3 ba3b77644

@dckc
Copy link
Collaborator Author

dckc commented Oct 13, 2023

We really should tweak the proposal so it uses the already-installed fluxAggregator contract installation (called priceAggregator in agoricNames.installation).

In particular, this permit to add/replace any entry in agoricNames.installation should not be granted:

"installation": {
"produce": "makeCoreProposalBehavior"
},

likewise, nor this one:

"installation": {
"consume": {
"mintHolder": true,
"scaledPriceAuthority": true
},
"produce": "makeCoreProposalBehavior"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant