-
Notifications
You must be signed in to change notification settings - Fork 37
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
Update Pool Box #80
Update Pool Box #80
Conversation
Awesome!
Good question! I think it's a legit case. I asked @scalahub in https://github.com/ergoplatform/eips/pull/41/files?diff=unified&w=1#r927416773 |
Pull Request Test Coverage Report for Build 2838458722
💛 - Coveralls |
Currently trying to get a simple update operation working on testnet, unfortunately it's being a bit spotty right now in terms of blocks. Also, I was wondering what the interface should be like for updating. Currently I have a rather simple setup where update-pool reads oracle_config.yaml, and compares refresh NFT/update NFT tokens to the pool box's parameters and sets it up from that. (No support for new reward tokens currently in the interface). Ideally though we should have some sort of partial bootstrap feature, since right now I'm testing it with a refresh NFT I minted myself and that isn't guarded by any contract. |
Great!
Oh yeah, the new refresh NFT should be in a box with the new refresh contract. Otherwise, oracles are voting for a blank check, right? Since we need to have a new refresh contract with a new refresh NFT before the voting, I suppose a new command is in order. Something like `UpdateRefreshContract`` which mints the new refresh NFT and puts it in the box with the new refresh contract. |
Hmm, the method I had in mind was to rework/copy the bootstrap steps, but allow specifying tokens/contracts for each step in the process. So if for example, you provide a pool Box, it won't mint a new one. Then you could maybe have something like update_config.yaml, that has optional parameters for each contract, something like: #[derive(Serialize, Deserialize)]
struct UpdateConfig {
update_contract_parameters: Option<UpdateContractInputs>,
refresh_contract_parameters: Option<RefreshContractInputs>, //and so on.
} |
That's interesting. I see how the update is similar to the bootstrap. |
The |
Successfully did a pool update on testnet with new refresh NFT, albeit I had to mint it myself for the time being |
Nice! |
During the above mentioned testnet try, I ran into a small issue regarding the Update Contract. I had some ballot tokens still in my wallet, and as we need an input box from wallet for fees, the update contract failed because the registers were not defined:
I don't think however that we necessarily need to update the contract, in theory adding a check for b.R8[Any].isDefined before accessing the registers would work, but it'd increase the size of the contract. Second, eventually we'd have a way to transfer ballot tokens from oracle-core, so there wouldn't be any need to keep the ballot tokens in the wallet anymore. For now I guess I could add a warning/error if the wallet address contains ballot tokens |
This requirement is now removed from the contract. See ergoplatform/eips#41 (comment) . Please, update the contract on our side. |
Nice find! I wonder if ballot tokens would be all sent out to the operators. I mean, I can imagine "bootstraper" can have some extra ballot tokens left in their wallet for future participants and whatnot. OTOH, update pool box operation most likely would be carried out after the pool had been working for quite some time. So it's not that unreasonable to require "no extra ballot tokens" for the operator that runs the update operation. I'd rather leave it as is with a warning. @kettlebell WDYT? BTW, I did not plan any command to send out the ballot tokens. It can be done with a regular send command in the wallet. |
Yeah I agree that the bootstrapper could very well have extra ballot tokens especially if he wants to keep control of the updating process until things settle and the other participants are trustworthy enough to deserve a ballot token. It's extra work on your part @SethDusek, but how about excluding any ballot-holding boxes from the wallet for the inputs? In theory this could mean no boxes would be available for fees, then we could return an error for the operator to remedy this. What do you guys think? |
I like this idea! I mean most likely there will be enough boxes for a fee without a box with ballot tokens. Otherwise, a fatal error is in order with a recommendation to move ballot tokens to another wallet. |
For generating a bootstrap file, currently the script addresses are in mainnet format
… + sort by ballot tokens + value in update_pool
Thank you for the detailed review, I'll work on the changes and re-request review when it's ready. |
Some reward tokens may have > i32::MAX (~2 billion) tokens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Thank you! Just a typo in doc comment.
Co-authored-by: Denys Zadorozhnyi <[email protected]>
Hi, here's some initial work for #49.
I have some questions.