Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Introduce Partial Set Security (#1809)
* cleanup ./changelog entries * docs: changelog and release notes for v4.0.0 (#1564) * add v4.0.0 section to changelog * add release notes * fix!: Validation of SlashAcks fails due to marshaling to Bech32 (backport #1570) (#1577) fix!: Validation of SlashAcks fails due to marshaling to Bech32 (#1570) * add different Bech32Prefix for consumer and provider * separate app encoding and params * remove ConsumerValPubKey from ValidatorConfig * update addresses in tests * make SlashAcks consistent across chains * add comments for clarity * Regenerate traces * Fix argument order * set bech32prefix for provider to cosmos * add changelog entries * add consumer-double-downtime e2e test * update nightly-e2e workflow * fix typo * add consumer-double-downtime to testConfigs * remove changes on provider * skip invalid SlashAcks * seal the config * clear the outstanding downtime flag for new vals * add info on upgrading to v4.0.0 * fix upgrade handler * fix changeover e2e test * Update tests/e2e/config.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update tests/e2e/config.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * add AccountPrefix to ChainConfig * fix docstrings * update AccountAddressPrefix in app.go * fix consumer-misb e2e test --------- Co-authored-by: Philip Offtermatt <p.offtermatt@gmail.com> Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> (cherry picked from commit 8604692) Co-authored-by: Marius Poke <marius.poke@posteo.de> * docs: update changelog for v4.0.0 (#1578) update changelog * docs: prepare for v4.0.0 (#1581) * unclog build * update release notes * update release date * feat!: enable Opt In and Top N chains through gov proposals (#1615) * init commit * added test * fixed tests * added changelog entry and comment * Update x/ccv/provider/keeper/proposal_test.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update .changelog/unreleased/features/1587-enable-opt-in-chains-through-gov-proposals.md Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * changed to tabular test --------- Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * feat!: introduce MsgOptIn and MsgOptOut (#1620) * init commit * cleaning up * changed cons to val address * Revert "changed cons to val address" This reverts commit a32e882. * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * took into account comments * added key assignment * add contraint such that opt out only works if the chain is running --------- Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * test: MBT: Add partial set security to model (feature branch version) (#1627) * Port changes from branch to main * Add model analysis changes to Makefile * test: Ports key assignment to the driver on the PSS feature branch (#1628) * Port key assignment to MBT driver * Add comment and make var names clearer * feat!: automatically opt in validators that vote Yes on consumer addition proposals (#1629) * init commit * changed providerKeeper.GetProposedConsumerChain to return a bool * add logging mesages * one more log message * fix comment * added one more test case of NO vote and made tabular test * test: Add driver for PSS (#1636) * Port key assignment to MBT driver * Add PSS trace generation * Add PSS trace gen to longer trace gen * Start handling top N parameter for new consumers * Finish merge * Add handling for optin/optout steps * Remove expected error from OptIn, which should not error * set top N parameter during path setup * Add comment to setup.go * feat!: add PSS reward distribution spike (#1632) * PSS reward distribution * "add optin mapping to test" * Update app/provider/app.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs * add TODO * fix Dos vector in IBCMiddlewarea * add reformat * fix DOS issue and make integration tests pass * doc * add integration test * doc * Compute total vp per consumer * add comments * remove opt-in comments and add TODOs * format * Update x/ccv/provider/keeper/distribution.go Co-authored-by: insumity <karolos@informal.systems> * add UT + doc * Update tests/integration/distribution.go Co-authored-by: insumity <karolos@informal.systems> * Update tests/integration/distribution.go Co-authored-by: insumity <karolos@informal.systems> * nits * Update x/ccv/provider/ibc_middleware.go Co-authored-by: Marius Poke <marius.poke@posteo.de> * add panics in IBC Middleware ICS4wrapper funcs * address comments --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Marius Poke <marius.poke@posteo.de> * feat! use protos to serialize opted-in validators (#1659) move OptedInValidators to proto Co-authored-by: insumity <karolos@informal.systems> * feat!: PSS enable per-consumer chain commission (#1657) * add draft commission * implement consumer commission draft * formatting * add msg handling * improve UT * nits * Update x/ccv/provider/keeper/keeper.go Co-authored-by: insumity <karolos@informal.systems> * Update proto/interchain_security/ccv/provider/v1/tx.proto Co-authored-by: Marius Poke <marius.poke@posteo.de> * optimize keys * Update x/ccv/provider/keeper/keeper.go Co-authored-by: insumity <karolos@informal.systems> * address comments * address comments * remove unnecessary check * Revert "remove unnecessary check" This reverts commit 2951e9b. * fix minor bug in StopConsumerChain --------- Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Marius Poke <marius.poke@posteo.de> * test: update integration test suite for PSS (#1687) * draft multi consumer transfer setup and test * format multi consumer distribution test * update test for democ consumer chains * nits * nit * docs: changelog and release notes for v4.0.0 (#1564) * add v4.0.0 section to changelog * add release notes * fix!: Validation of SlashAcks fails due to marshaling to Bech32 (backport #1570) (#1577) fix!: Validation of SlashAcks fails due to marshaling to Bech32 (#1570) * add different Bech32Prefix for consumer and provider * separate app encoding and params * remove ConsumerValPubKey from ValidatorConfig * update addresses in tests * make SlashAcks consistent across chains * add comments for clarity * Regenerate traces * Fix argument order * set bech32prefix for provider to cosmos * add changelog entries * add consumer-double-downtime e2e test * update nightly-e2e workflow * fix typo * add consumer-double-downtime to testConfigs * remove changes on provider * skip invalid SlashAcks * seal the config * clear the outstanding downtime flag for new vals * add info on upgrading to v4.0.0 * fix upgrade handler * fix changeover e2e test * Update tests/e2e/config.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update tests/e2e/config.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * add AccountPrefix to ChainConfig * fix docstrings * update AccountAddressPrefix in app.go * fix consumer-misb e2e test --------- Co-authored-by: Philip Offtermatt <p.offtermatt@gmail.com> Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> (cherry picked from commit 8604692) Co-authored-by: Marius Poke <marius.poke@posteo.de> * docs: update changelog for v4.0.0 (#1578) update changelog * feat!: enable Opt In and Top N chains through gov proposals (#1615) * init commit * added test * fixed tests * added changelog entry and comment * Update x/ccv/provider/keeper/proposal_test.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update .changelog/unreleased/features/1587-enable-opt-in-chains-through-gov-proposals.md Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * changed to tabular test --------- Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * feat!: introduce MsgOptIn and MsgOptOut (#1620) * init commit * cleaning up * changed cons to val address * Revert "changed cons to val address" This reverts commit a32e882. * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * took into account comments * added key assignment * add contraint such that opt out only works if the chain is running --------- Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * test: MBT: Add partial set security to model (feature branch version) (#1627) * Port changes from branch to main * Add model analysis changes to Makefile * feat!: add PSS reward distribution spike (#1632) * PSS reward distribution * "add optin mapping to test" * Update app/provider/app.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * docs * add TODO * fix Dos vector in IBCMiddlewarea * add reformat * fix DOS issue and make integration tests pass * doc * add integration test * doc * Compute total vp per consumer * add comments * remove opt-in comments and add TODOs * format * Update x/ccv/provider/keeper/distribution.go Co-authored-by: insumity <karolos@informal.systems> * add UT + doc * Update tests/integration/distribution.go Co-authored-by: insumity <karolos@informal.systems> * Update tests/integration/distribution.go Co-authored-by: insumity <karolos@informal.systems> * nits * Update x/ccv/provider/ibc_middleware.go Co-authored-by: Marius Poke <marius.poke@posteo.de> * add panics in IBC Middleware ICS4wrapper funcs * address comments --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Marius Poke <marius.poke@posteo.de> * feat!: PSS enable per-consumer chain commission (#1657) * add draft commission * implement consumer commission draft * formatting * add msg handling * improve UT * nits * Update x/ccv/provider/keeper/keeper.go Co-authored-by: insumity <karolos@informal.systems> * Update proto/interchain_security/ccv/provider/v1/tx.proto Co-authored-by: Marius Poke <marius.poke@posteo.de> * optimize keys * Update x/ccv/provider/keeper/keeper.go Co-authored-by: insumity <karolos@informal.systems> * address comments * address comments * remove unnecessary check * Revert "remove unnecessary check" This reverts commit 2951e9b. * fix minor bug in StopConsumerChain --------- Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Marius Poke <marius.poke@posteo.de> * fix nits in MBT model after merging #1676 from main * Fix merging ccv model * Remove conflict markers * Remove more conflict markers * EndProviderEpoch takes ConsumerAdditionMsg * Fix using consumer addition msgs instead of chain names in boundeddrift.qnt * lint * chore: rebase PSS branch with main (#1689) * Update tests/mbt/driver/mbt_test.go * nits * revert unwanted line deletion from linter --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * feat!: complete the PSS reward distribution (#1709) * update compute consumer total power for reward distribution * update distribution logic to work with epochcs * Adapt reward distribution mem test to epochs * doc * nits * other nits * nits * Update tests/integration/distribution.go * feat!: Add slashing logic for PSS (#1710) * add check for consumer validators in downtime logic * fix UT * try to fix weird errors in gh worfklow * fix silly merge bug * nits * ci: do not scan the tests for security issues (#1717) init commit * feat!: compute partial sets (#1702) * init commit * nit change * cleaning up * clean up * fix distribution test * Update x/ccv/provider/keeper/hooks.go Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * took into Simon's comments * took into rest of the comments * nit change * return an error if validator cannot opt out from a Top N chain * removed automatic opt-in for validators that vote Yes on proposals * tiny fix for E2E tests * nit change to remove unecessary else * fixed topN == 0 issue --------- Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * feat!: update PSS cli (#1708) finalize PSS CLI cmds * Rename and add comission rate command to commands * feat!: only perform consumer additions for non-empty chains (#1730) * init commit * Update x/ccv/provider/keeper/proposal.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * feat: Add queries for PSS and consumer commission rate (#1733) * init commit * nit change * cleaning up * clean up * fix distribution test * Update x/ccv/provider/keeper/hooks.go Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com> * took into Simon's comments * took into rest of the comments * nit change * return an error if validator cannot opt out from a Top N chain * removed automatic opt-in for validators that vote Yes on proposals * tiny fix for E2E tests * nit change to remove unecessary else * update consumer chains query to return topN * update query consu chains proto * add consumer chains per validator query * Add PSS command to provider's cli * nits * add consumer commission rate query * nits * big renaming * fix doc * nits * nits * docs * Update proto/interchain_security/ccv/provider/v1/query.proto Co-authored-by: insumity <karolos@informal.systems> * nit * add OptedIn in QueryConsumerChainsValidatorHasToValidate * remove OptIn field in consumer chains query response * include validators that opt-in during the next epochs * update has-to-validate condition * fix tinny bug in the tests after merging feat/partial-security * update doc * update cli description * Update x/ccv/provider/keeper/grpc_query.go Co-authored-by: insumity <karolos@informal.systems> * changes --------- Co-authored-by: insumity <karolos@informal.systems> * fix!: Fix opt-in assignment (#1732) * Make the same validator assigning the same key a noop instead of an error * Adjust test * Update tests * Fix newline warning * Regenerate traces * Add key assignment change to changelog * Add info log for same key same validator assignments * Add changelog entry to api-breaking * Update x/ccv/provider/handler_test.go Co-authored-by: insumity <karolos@informal.systems> * Add more comments to test and return right validator --------- Co-authored-by: insumity <karolos@informal.systems> * fix silly bug in PSS opted-in val query * fix logging in ibc_module.go * test: add partial-set-security E2E tests (#1737) * init commit * fix traces * Add PSS to default tests * Update tests/e2e/steps_partial_set_security.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update tests/e2e/steps_partial_set_security.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> --------- Co-authored-by: Philip Offtermatt <p.offtermatt@gmail.com> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Nit changes based on Simons comments. To be pushed directly because E2E PR 1737 were the comments were written was accidentally merged. * fix!: return a SlashAck even if the validator is not a consumer validator (#1763) * init commit * fix test * test: Expand PSS e2e test to include slashing (#1752) * Expand test to include slashing * Add back existing steps * Add downtime to top N test * Fix nits * fix!: update unbonding pausing for PSS (#1728) * draft PSS unbonding fix * fix hook logic to retrieve validator address from ubd op * add unbonding pausing unit-test * remove panic in hook * Get back 3.2.0 and 3.3.0 changelog from main * Port epilogue from main * Fix proto conflict * generate proto files * Port RELEASE_NOTES * Fix merge for tests * Merge declaration and assignment * Clean up model files * Add pss tests to MBT readme * Restore MsgSubmitConsumerDoubleVoting handler * Remove local driver files * Remove Quint guidelines * Add optin/optout to MBT readme * Fix types in model * Fix model * Add migration * Ensure SlashAcks are sent even when the valset does not change * adding changelog entry * Empty DowntimeSlachAcks on EndBlock * Remove logs * Change condition for sending slash acks * Revert model changes * Start fixing PSS issues in model * Add expected errors to opt out action * Revert PSS quint model changes * Add parameter to ComputeNextEpochConsumerValSet * Set top N param in setup * Fix: do not try key assignment if there is no nonjailed validator * Do not assign keys for jailed validators * Only jail validators with non-zero-power * Add unit test * Add unit test for unset case * Panic on not being able to unmarshal * Move packet handling into ack.Success block * Format * Remove unnecessary comment * Add parens for clarity * Format and fix typo * Move OptIn/OptOut events to provider events * Remove unused function * Improve comments for keys * Improve comments for key getter functions * Remove order change for existing keys * Re-add nolint instruction * nit comment fix * Move ConsumerAllocationTests to correct folder * nit comment fix * fix!: handle consumer commission marshalling errors gracefully (#1836) * handle consumer commission setter/getter gracefully to avoid BeginBlock panic + add msg in codec * fix consumer commission query rest path * fix: update queries REST path for PSS (#1839) update queries rest path * Clarify that GetProposedConsumerChain is test-only * fix: Fix has-to-validate query (#1823) * Fix has-to-validate query * Flip comparison sign for checking minPower * Regenerate traces * Remove unnecessary print * Address comments * fix!: fix slashing in PSS (#1838) * drop slash packet for opted-out validators before updating slash meter * fix integration test * fix ut * update UT * Update x/ccv/provider/types/msg.go Co-authored-by: Marius Poke <marius.poke@posteo.de> * Remove BlockValidatorUpdate from expected staking keeper * added an error response value to ComputeMinPowerToOptIn * delete additional state when we stop a chain * Assign keys and change voting power only for unjailed nodes with >0 power * fix: Validate consumer commission rate against minimal rate (#1834) * Validate consumer commission rate * Add test for commission rates * Remove static minimum commission rate validation from Set * feat!: introduce power shaping (#1830) * added power shaping * fixes * Add property based test for power cap * fixed tests & added algorithm's idea * nit changes * Update x/ccv/provider/keeper/proposal.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * remove empty-validator-set check * implicit memory aliasing issue fixed * added keeper tests * updated HasToValidate query * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update x/ccv/provider/keeper/keeper.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * took into account comments * do not use cached ctx * Fix E2E test. A jailed validator does not have to validate. * fix merge issue and format --------- Co-authored-by: Philip Offtermatt <p.offtermatt@gmail.com> Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update v4 to v5 in package version * Bump consensus version * Add migration in correct folder * Update version from v4 to v5 in migration --------- Co-authored-by: mpoke <marius.poke@posteo.de> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: insumity <insumity@users.noreply.github.com> Co-authored-by: insumity <karolos@informal.systems> Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
- Loading branch information