Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(cli,oracle): export + vote power (ExocoreNetwork#53) * fix(oracle):skip cache commit when refill cache on node restart * text: add comments * fix(oracle):set recentParams when commit cached params * typo(oracle):lint * fix:CVE-2024-3817, update getter to 1.7.4 * fix(cli): make `export` work again * fix(dogfood): remove debug line * refactor(dogfood): load `AccAddress` for val * fix(oracle): use `GetConsensusPower` correctly The `v.GetConsensusPower` function expects the power reduction factor as a parameter, and not the number of bonded tokens (that is available to the validator object anyway). * fix(cli): pass `chainID` via `ctx` and not param Tested with `exocored export | jq` * fix(ci): remove deprecated config * fix(test): remove call count for GetBondedTokens --------- Co-authored-by: leonz789 <[email protected]> Co-authored-by: cloud8little <[email protected]> * fix(delegation): don't error if no delegations (ExocoreNetwork#60) * fix(delegation): don't error if no delegations If both the operator and its stakers exit the system, the TotalAmount and TotalShare are 0. In that event, it is not erroneous to return a value of 0 for the share and the amount, respectively. Updates tests as well Fixes ExocoreNetwork#59 * chore: use lowercase for local var * feat: CLIs for delegation, operator, dogfood (ExocoreNetwork#46) * refactor(operator): use flags to RegisterOperator Instead of relying on the positioning of arguments, the flags mechanism (as seen in the Cosmos SDK's x/staking) offers a cleaner approach. * feat(operator): add commission rate to CLI * refactor(operator): validate registration input * feat(operator): add `OptIn` to AVS function * refactor(assets): remove app chains These should be in the AVS module anyway. * fix(operator): share `opt.go`, `consensus_keys.go` An operator must first opt into the chain-as-an-AVS before assigning a consensus key for said chain. Similarly, to opt out, the operator must first remove their key and then opt out. * fix(operator): correct interface * fix(dogfood): remove unused code * feat(operator): add AVS opt out CLI * fix(operator): implement msg server * feat(operator): implement cons key interfaces * fix(operator): skip opting out operators from list * fix typos * fix(dogfood): update operator hook assumptions * feat(operator): add QueryAllOperatorKeysByChainID * feat(operator): implement QueryOperatorConsAddress * feat(operator): implement QueryAllOperatorConsAddr * feat(dogfood): implement QueryOptOutsToFinish * feat(dogfood): QueryOperatorOptOutFinishEpoch * feat(delegation): query undelegation hold count * feat(dogfood): implement QueryUndelegationsToMature * fix(delegation): use string record key type * feat(dogfood): query undelegation maturity epoch * feat(dogfood): query validator * fix(operator): allow build * fix(dogfood): actually schedule cons addr prune * chore: lint and tests * fix: use consistent naming of query members * remove unused comments * doc: update comment for why chain not chain_id * fix(operator): add Router for tx * chore(lint) * fix(test): fix operator tests, disable 1 * fix(proto): prevent complains about duplicate reg * fix(operator): query operator CLI with address * feat(operator): add set-cons-key and removal cli * fix(dogfood,operator): clear prev keys correctly AVSs are free to choose their own epoch schedule. The previous key needs to be cleared only at epoch end (and not at block end as it was done previously). Additionally, it is specific to the AVS identifier (the chainID in the case of the dogfood module) that should be cleared. BREAKING: the format of storing the previous consensus keys has changed. Previously, they were indexed by operator's AccAddress and chainID. Now they are indexed by the reverse of it, that is, chainID + AccAddress. This is done to ensure easy clearing of the data for each specific AVS. BREAKING: the `prefixSlashAssetsState` and another prefix were sharing the same value of 5 `BytePrefixForOperatorAndChainIDToConsKey`. This has been fixed. * fix(operator): remove pointer receiver * refactor: clarify all vs active operators * feat(operator): add get all operators query * fix(operator): parse cons key correctly * chore(lint): placate proto-lint * chore(lint): placate golang lint * fix(operator): impl for msgs GetSignBytes, Type Without these functions implemented, sending a transaction with the wrong chain-id produces a panic while verifying the signature. This panic happens on the receiving node (and not the sender), although consensus isn't impacted. With these functions implemented, the receiving node replies "signature verification failed, please verify account number (%d) and chain-id (%s)". If the transaction were only legacy amino, even the "sequence (%d)" would have shown up in the error message. * fix: validatorupdateblock update every block cause messy of upgrade (ExocoreNetwork#57) * fix(oracle): add copy of aggregatorContext for checkTx-mode of execution (ExocoreNetwork#50) * fix(oracle): add copy of aggregatorContext for checkTx-mode of execution * fix lint * fix(oracle):use set to copy bigInt * fix(oracle):deep copy on price * fix(oracle):get rid of map in cache for deteministic serialize * fix(oracle):bigint set, slice initialize * GetConsensusPower should have reduction as input * test(oracle): remove unused monkey-patch * test: remove unused monkey mock * fix: error retruned by precompiled contract can not be caught with tr… (ExocoreNetwork#69) * fix: error retruned by precompiled contract can not be caught with try/catch in EVM * fix withdraw_integrate_test * fix failed tests and add some TODO comments * patch clientchains precompile * [fix] Fix the issue regarding voting power not taking effect (ExocoreNetwork#65) * fix the issue ExocoreNetwork#58 regarding voting power not taking effect * change prepareDelegation to be compatible with PR61 * update ibc-go to v7.4.0 to fix the Vulnerability GO-2024-2694 * change the epoch configuration to hour when start a local node through the local_node.sh * using shfmt to fix the shell lint error * refactor: refactor avs and add test * oracle:add fields for params (ExocoreNetwork#75) * oracle:add fields for params * udpate default params with new fields * fix lint * test(oracle): convert int type * feat(build): add commit hash in version name (ExocoreNetwork#76) * fix:fix golangci-lint error * fix:fix issues in comments * fix(assets,delegation): case insensitive query (ExocoreNetwork#80) * fix(delegation): convert query to lowercase * fix(assets): convert query to lowercase * refactor(assets,delegation): check case with flag * fix(assets,delegation): stateless validate cli * fix(assets): deprecate StakerExoCoreAddr * fix(assets): remove StakerExoCoreAddr * fix(assets): require non-zero address length (ExocoreNetwork#82) * fix(localnet): set `address_length` * fix(assets): validate non-zero address length * fix(app): reorder the EndBlockers (ExocoreNetwork#98) * chore: update go version to 1.21.11 * fix(ci): disable buggy workflows till they can be fixed * fix(app): reorder the EndBlockers The `EndBlockers` do the following jobs: - `x/operator` saves the USD value for delegations, indexed by operator. - `x/dogfood` uses the USD value obtained from `x/operator` to calculate the new voting power and forwards the new validator set to Tendermint. It also decreases the hold count on pending undelegations maturing at that epoch, from the perspective of the dogfood-AVS. - `x/delegation` releases any matured undelegations and makes assets available for withdrawal. - `x/oracle` fetches the new voting power from `x/dogfood` and prepares for the next round. The new order is updated to reflect the above functions. As a consequence, delegations made during blocks just before the epoch ends will also accurately update the vote power of the validators. * chore: lint * fix(docker): update to new alpine * feat(ci): add `docker build` CI * chore(ci): run `lint` on workflows * chore(ci): run `lint` on workflows again * fix(ci): trigger Dockerbuild only if file changes * fix(ci): remove backticks from workflow name * fix(ci): lint the workflow again * fix(ci): use correct path to trigger * fix(ci): specify go version in consensuswarn (ExocoreNetwork#103) * refactor(dogfood): return cons key in `Validator` (ExocoreNetwork#72) * refactor(dogfood): return cons key in `Validator` Until `x/dogfood` was made compatible with `x/evm` and `x/oracle`, a `nil` validator was being returned by `ValidatorByConsAddr`. This validator was correctly processed by the `x/evidence` module when it handled equivocation evidence. However, with the changes introduced for compatibiltiy with `x/evm`, the validator returned is no longer nil. Such a validator will have an operator address, whose presence will trigger a call to `Validator`, which is implemented by this change. * fix(dogfood): add expected keeper interface * fix(dogfood): return `validator` not `val` * fix(operator,dogfood): return val with key * fix(dogfood): correctly set bonded status The validators loaded from x/dogfood are considered bonded, while the validators pulled from x/operator can have any status. * doc(dogfood): add error logs * fix(ci): specify go version in consensuswarn * feat(dogfood): implement `ExportGenesis` (ExocoreNetwork#95) * feat(dogfood): re-scaffold genesis In preparation for the `ExportGenesis` implementation, re-scaffold the genesis state of the dogfood module. * fix(dogfood): remove deprecated keys * refactor: use new dogfood genesis * refactor(dogfood): - validatorupdate from gen * refactor(dogfood): update ImportGenesis ...for new genesis structure * refactor(dogfood): simplify gen state names * feat(dogfood): implement ExportGenesis Partially resolves ExocoreNetwork#54 * chore: lint * proto(dogfood): remove unused import * fix(local): compat with new dogfood genesis * chore: lint proto file and gen * fix(test): use correct struct member name * chore: update go version to 1.21.11 * fix(ci): disable buggy workflows till they can be fixed * chore: lint * fix(dogfood): don't stop iterating in export The return value should be `false` to continue * fix(doc): add comment about exported validators * doc(dogfood): log iteration failure If such an iteration failure happens during export, a pipe to `jq` will fail and inform the user of the failure. * docs(delegation): validation of record key params * fix(app): register operator hooks for dogfood * feat(operator): return `OptingOut` status Whenever a query for consensus keys or addresses is answered, it should specify whether the operator is currently in the process of opting out. This is because the data is retained until the opt out is complete, even though the operator may not be actively validating. The purpose of the data retention, as always, is to slash the operator (if required), based on the key. * refactor(operator): rationalize opt-in/out When an operator opts into an AVS, they should be required to supply the consensus (or other) key to opt-in. Similarly, when they opt-out, the key should automatically be removed. This commit implements that functionality, however, it is restricted to `ctx.ChainID()`. For an overbroad implementation, an AVS registry from AVS address -> key type should be implemented. * refactor(delegation): verbose panic * fix(dogfood): query validator by cons addr not hex * refactor(dogfood): move opt func to correct loc * chore(x/operator): lint go * fix(operator): wrap and return error --------- Co-authored-by: cloud8little <[email protected]> * fix(ci): upgrade deprecated goreleaser - Set version in `.goreleaser.yml` - Correct the `goreleaser-cross` version to use the latest available and compatible version - Update workflow to test release builds on pull requests, but not publish them --------- Co-authored-by: Max <[email protected]> Co-authored-by: leonz789 <[email protected]> Co-authored-by: Leon <[email protected]> Co-authored-by: adu <[email protected]> Co-authored-by: TimmyExogenous <[email protected]> Co-authored-by: trestin <[email protected]> Co-authored-by: trestin-web3 <[email protected]>
- Loading branch information