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(oracle): add copy of aggregatorContext for checkTx-mode of execution #50

Merged
merged 9 commits into from
May 27, 2024

Conversation

leonz789
Copy link
Contributor

@leonz789 leonz789 commented May 5, 2024

Description

Before transaction be added to mempool, it will be executed in checkTx and that will update the caches in aggregator. We should separate the caches between checkTx and deliverTx.

  • reset aggregatorContextForCheckTx after block execution completed(deliverTx) in Endblock
  • branch aggregatorContext when the first transaction show up for checkTx mode execution in a block

pending:

  • compatible with dogfood

Closes #XXX

x/oracle/keeper/aggregator/aggregator.go Dismissed Show dismissed Hide dismissed
x/oracle/keeper/aggregator/aggregator.go Fixed Show fixed Hide fixed
x/oracle/keeper/aggregator/calculator.go Fixed Show fixed Hide fixed
x/oracle/keeper/aggregator/filter.go Dismissed Show dismissed Hide dismissed
x/oracle/keeper/aggregator/filter.go Dismissed Show dismissed Hide dismissed
x/oracle/keeper/aggregator/context.go Dismissed Show dismissed Hide dismissed
x/oracle/keeper/aggregator/context.go Dismissed Show dismissed Hide dismissed
x/oracle/module.go Dismissed Show dismissed Hide dismissed
reports: make([]*reportPrice, 0, len(agg.reports)),
dsPrices: agg.dsPrices,
}
for k, v := range agg.dsPrices {
Copy link
Contributor

Choose a reason for hiding this comment

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

there are dsXXX detXXX for Deterministic. this abbreviation naming is not easy to maintain and not clear for readers to understanding.
It is recommended uniform the dsPrices with detPrices (deterministic) and add clear comment for the related variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ds is for deterministic-source, corresponding to ns: nondeteministic-source
detID for deterministicID

Copy link
Contributor

@MaxMustermann2 MaxMustermann2 left a comment

Choose a reason for hiding this comment

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

Minor changes requested. Could you add some more comments or maybe a README to the overall module? It'll help in making the code easier to understand when debugging. Thanks!

x/oracle/keeper/aggregator/aggregator.go Outdated Show resolved Hide resolved
x/oracle/keeper/aggregator/calculator.go Outdated Show resolved Hide resolved
x/oracle/keeper/aggregator/calculator.go Outdated Show resolved Hide resolved
x/oracle/keeper/aggregator/calculator.go Outdated Show resolved Hide resolved
x/oracle/keeper/aggregator/calculator.go Outdated Show resolved Hide resolved
x/oracle/keeper/aggregator/calculator.go Fixed Show resolved Hide resolved
@leonz789 leonz789 force-pushed the develop-oracle-fixchecktx branch from efb540e to dc3621d Compare May 12, 2024 09:35
x/oracle/keeper/aggregator/aggregator.go Dismissed Show dismissed Hide dismissed
x/oracle/keeper/aggregator/calculator.go Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@MaxMustermann2 MaxMustermann2 left a comment

Choose a reason for hiding this comment

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

Please fix conflicts and check for the impact of non-determinism within map iteration before merging. Given it is within checkTx I don't expect there to be any, do you agree?

@leonz789 leonz789 force-pushed the develop-oracle-fixchecktx branch from 1781678 to 91160d8 Compare May 22, 2024 02:08
@leonz789
Copy link
Contributor Author

Please fix conflicts and check for the impact of non-determinism within map iteration before merging. Given it is within checkTx I don't expect there to be any, do you agree?

Yes, map only used when read from state and safe, state are stored as list.

@cloud8little
Copy link
Contributor

@leonz789 please resolve the conflict.

@leonz789 leonz789 force-pushed the develop-oracle-fixchecktx branch from dcc58ff to 57b564a Compare May 27, 2024 02:28
@mikebraver mikebraver merged commit c1b79bb into ExocoreNetwork:develop May 27, 2024
16 checks passed
@cloud8little cloud8little added this to the Testnet V3 milestone May 27, 2024
cloud8little added a commit to cloud8little/exocore that referenced this pull request Jun 21, 2024
* 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

* feat(epochs): backport the epochs module

* fix: run go mod tidy

* fix(local): minute-wise epochs

* fix(dogfood): set default unbonding duration 7 day

* fix(local): unbond at 2 epochs

* fix(ci): fix failing jobs

* refactor(epochs): respond to ai review

* fix(ci): specify go version in consensuswarn (ExocoreNetwork#103)

* fix(docs): add `the` before module

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* 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

* epochs: return block time in query

The returned block time can be used to determine whether any of the
epochs are about to change.

* doc(epochs): clarify no problems with timezones

* fix(ci): provide github token to buf setup

avoid rate limits

* 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]>

* feat(ci): allow super-linter running with act

Example usage:
act --workflows .github/workflows/super-linter.yml pull_request

* remove unused file

* fix: typo in script

---------

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]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
cloud8little added a commit to cloud8little/exocore that referenced this pull request Jun 21, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants