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

Add random chance to panic mode for DependencyAudit #35

Conversation

janezpodhostnik
Copy link
Contributor

Description

Add the ability to set an end and start block between which the change of a transaction with unstaged dependencies panicking linearly increases.


For contributor use:

  • Targeted PR against main branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@janezpodhostnik janezpodhostnik requested a review from a team as a code owner June 10, 2024 18:07
panic("This transaction is using dependencies not staged for Crescendo upgrade coming soon! Learn more: https://bit.ly/FLOWCRESCENDO. Dependencies not staged: ".concat(unstagedDependenciesString))
} else {
emit UnstagedDependencies(dependencies: unstagedDependencies)
self.maybePanicOnUnstagedDependencies(unstagedDependencies)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm missing something - why do we want to randomly panic here? I would think we'd want clear expectations around whether unstaged dependencies panic or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The business requirement is that there would be a random chance the transaction would fail if it is missing dependencies. That random chance would start at 0% and increase to 100% just before the spork.

Copy link
Contributor

@sisyphusSmiling sisyphusSmiling Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I still don't understand the rationale behind that product decision, but not sure this is the place to discuss prod reqs so I'll just review based on that stated requirement

Copy link
Contributor

@sisyphusSmiling sisyphusSmiling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple comments about events and input validation. The premise of linearly increasing probability of reversion on unstaged dependencies seems to be implemented correctly

contracts/DependencyAudit.cdc Outdated Show resolved Hide resolved
contracts/DependencyAudit.cdc Show resolved Hide resolved
contracts/DependencyAudit.cdc Show resolved Hide resolved
contracts/DependencyAudit.cdc Show resolved Hide resolved
contracts/DependencyAudit.cdc Show resolved Hide resolved
@sisyphusSmiling sisyphusSmiling merged commit 0a0d1d8 into onflow:main Jun 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants