[Feature] Updates to support program upgradability.#3587
[Feature] Updates to support program upgradability.#3587
Conversation
|
UPDATE: a check in
|
| @@ -181,6 +182,8 @@ impl<N: Network, C: ConsensusStorage<N>, R: Routing<N>> Rest<N, C, R> { | |||
|
|
|||
| // GET ../program/.. | |||
| .route(&format!("/{network}/program/:id"), get(Self::get_program)) | |||
There was a problem hiding this comment.
Is there a way to return the edition from the original get_program endpoint? If not, we may want to consider adding an optional Metadata to the query that surfaces it, and potentially other info like owner, tx_id, etc.
There was a problem hiding this comment.
I'm not sure you can without breaking the API.
The Metadata option seems reasonable.
There was a problem hiding this comment.
I added the option for metadata, returning the edition and TX ID.
I did not add ProgramOwner, since it is not used for anything.
I took a stab at adding it in. |
Awesome.
Excellent point, you are right, especially because Additionally, primary.rs is getting pretty huge, so I think this would be a timely moment for a tiny refactor. Suggestion: move the 1. batch proposal limit checks and 2. the program upgradability checks into a new |
A couple questions/points here:
|
Alright, it indeed looks more manageable right now, thank you.
UPDATE: a check in snarkVM's
|
|
Confirming after recent discussions: there is no need to add the transaction-level migration logic at the snarkOS level (because it would only offer a small performance benefit if we would avoid processing the transmissions from malicious validators, which is not a priority). Consider closing this PR and opening a new one so future reviewers don't have to go through all the above comments. O:) |
| // If the `ConsensusVersion` is greater than or equal to V5: | ||
| // - ensure the transaction doesn't bring the proposal above the spend limit. | ||
| // Otherwise: | ||
| // - ensure that the transaction does not use constructors, the checksum operand, or edition operand. | ||
| // - ensure that `program_checksum`s in deployments are `None`. | ||
| // TODO: @d0cd this ^ needs to be updated to the correct version once we have pinned it down. | ||
| if N::CONSENSUS_VERSION(block_height)? >= ConsensusVersion::V5 { |
There was a problem hiding this comment.
@d0cd want to remove this checking logic at the snarkOS level - as we agreed snarkVM level is sufficient?
|
Closing PR per the above recommendation to open a new one. |
For now, this will use the
testing/program-updatability+stagingbranch of snarkVM until the PRs on snarkVM are ready.This PR introduces updates needed to support program upgradability. Concretely: