-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[Feature] Updates to support program upgradability. #3587
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure you can without breaking the API.
The Metadata
option seems reasonable.
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.
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:) |
node/bft/src/primary.rs
Outdated
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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+staging
branch of snarkVM until the PRs on snarkVM are ready.This PR introduces updates needed to support program upgradability. Concretely: