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

Fix Up Assertion Creation Logic #358

Merged
merged 5 commits into from
Jul 10, 2023
Merged

Fix Up Assertion Creation Logic #358

merged 5 commits into from
Jul 10, 2023

Conversation

rauljordan
Copy link
Collaborator

@rauljordan rauljordan commented Jul 7, 2023

This PR fixes up our assertion creation logic, which was completely broken. Because our tests do not use a real, Nitro validator, our tests do not fail for assertion validity. Instead, we make sure:

  • The assertion we are creating has the correct, pre-computed hash
  • If the assertion already exists, we return it instead of making a transaction
  • Use the parent assertion creation info for the BeforeState of the assertion being posted
  • Use the correct inbox batch accumulator when pre-computing our assertion hash
  • Fix tests to build upon the genesis assertion info

@rauljordan rauljordan self-assigned this Jul 7, 2023
@rauljordan rauljordan marked this pull request as draft July 7, 2023 19:37
@rauljordan rauljordan marked this pull request as ready for review July 7, 2023 19:37
return nil, errors.New("prev assertion creation info inbox max count not a uint64")
}
prevCreationInfo, err := a.ReadAssertionCreationInfo(ctx, protocol.AssertionHash(assertionCreationInfo.ParentAssertionHash))
newOpts := copyTxOpts(a.txOpts)
newOpts.Value = parentAssertionCreationInfo.RequiredStake
Copy link
Collaborator

Choose a reason for hiding this comment

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

What would happen if the dao were decide to raise the deposit stake? Shouldn't the stake be part of the config instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It needs to come from the parent assertion info, which is data onchain, so we should be OK here

@rauljordan rauljordan merged commit c872777 into main Jul 10, 2023
6 checks passed
@rauljordan rauljordan deleted the transact-checking branch July 10, 2023 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants