-
Notifications
You must be signed in to change notification settings - Fork 141
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
test: MBT: Add slashing to model #1640
Conversation
Err("not implemented") | ||
} | ||
|
||
pure def recvVscMaturedPacketOnProvider(currentState: ProtocolState, sender: Chain, packet: VscMaturedPacket): Result = { |
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.
moved from ccv_utils because the "sibling function" recvSlashPacketOnProvider needs to access a parameter from the module
tests/mbt/driver/generate_traces.sh
Outdated
go run ./... -modelPath=../model/ccv_sync.qnt -init initSync -step stepSync -traceFolder traces/sync_noinv -numTraces 2 -numSteps 30 -numSamples 1 |
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.
decreased numSteps here, since the traces were too large to open/work with. In turn, I increased the numTraces to 2, so it should still give some coverage but be easier to debug
@@ -3,11 +3,11 @@ | |||
echo "Generating bounded drift traces with timeouts" | |||
go run ./... -modelPath=../model/ccv_boundeddrift.qnt -step stepBoundedDrift -invariant CanTimeoutConsumer -traceFolder traces/bound_timeout -numTraces 20 -numSteps 200 -numSamples 200 | |||
echo "Generating long bounded drift traces without invariants" | |||
go run ./... -modelPath=../model/ccv_boundeddrift.qnt -step stepBoundedDrift -traceFolder traces/bound_noinv -numTraces 20 -numSteps 500 -numSamples 1 | |||
go run ./... -modelPath=../model/ccv_boundeddrift.qnt -step stepBoundedDrift -traceFolder traces/bound_noinv -numTraces 20 -numSteps 300 -numSamples 1 |
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.
Similar reasoning, traces were just too large to work with
@@ -17,7 +26,7 @@ func CreateValidators(n int) ( | |||
signersByAddress = make(map[string]tmtypes.PrivValidator, n) | |||
) | |||
for i := 0; i < n; i++ { | |||
privVal := mock.NewPV() | |||
privVal := mock.PV{PrivKey: ed25519.GenPrivKeyFromSecret([]byte(chainId + fmt.Sprint(i)))} |
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.
Changed to make this deterministic. This caused some other unrelated files to need to change.
pure val provValPower = if (provValSet.keys().contains(providerNode)) provValSet.get(providerNode) else 0 | ||
pure val consumersWithAddrAssignmentChangesInThisBlock = | ||
if (provValPower > 0) { | ||
// if the consumer has positive power, the relevant key assignment for the consumer changed | ||
if (provValPower > 0 and providerNode.in(nonJailedNodes(currentState.providerState))) { |
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.
Why don't we set the voting power of jailed validators to 0
?
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.
Because this makes unjailing operations hard, which we might want to add later, i.e. how would we know which power to restore the unjailed validator to? I filter the jailed validators out when the valset is entered on-chain during EndBlock
Co-authored-by: Simon Noetzlin <[email protected]>
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.
Great work!
Co-authored-by: Simon Noetzlin <[email protected]>
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.
LGTM. Great work @p-offtermatt
outstandingPacketsToConsumer: Chain -> List[Packet], | ||
|
||
// Stores the packets that the provider will send an ack for when it ends the current block. | ||
acksToSendOnEndBlock: Chain -> List[Packet], |
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.
Why are these sent on EndBlock? In the code SlashPackets are handled immediatelly.
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.
The code might send the acks immediately, but recall that they go through IBC, which will not process the acks before they are committed (i.e. the block is ended)
Description
Closes: #1531
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...