-
Notifications
You must be signed in to change notification settings - Fork 314
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
staking(tests): add validator tombstoning scenarios #4149
Comments
@cratelyn pointed out that the preferred pattern is to build mock data in the test and use an interface to inject it in block execution (unless I misunderstood) |
🔗 some handy links@erwanor, following up with some links to help you on your way! penumbra/crates/test/mock-consensus/src/block.rs Lines 58 to 61 in 70a3ed2
the block builder has a the
i suspect that most of what you'll need is already there! the one wrinkle will be sorting out the discrepancy between the |
This is perhaps best to split into multiple tickets, but at a high-level we want to:
Tombstoned
is a terminal stateFor context, the application receives misbehavior evidence from comet in the
BeginBlock
packet (and starting in0.38
,FinalizeBlock
either way we want to process evidence before tx execution), the application then forwards it to the staking component in ValidatorManager::process_evidence which then records the appropriate penalty and trigger a state transition.Ostensibly, there is very little validation done by the application because we assume that CometBFT has done it for us. We can't however assume that the evidence gets only delivered once or make any assumptions that are downstream of validator behavior (since it is byzantine!).
This is good news, because this means that to test this part of the staking logic we just need to:
Misbehavior
datum that specifies some cometbft address (that's the only data we need to populate!)Misbehavior
into aBeginBlock
packetAnd then we "just" need to inspect the staking state to assert the various invariants that we are looking for.
Originally posted by @erwanor in #4049 (comment)
The text was updated successfully, but these errors were encountered: