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(unjail): fix the issue regarding unjail failed #184

Merged

Conversation

TimmyExogenous
Copy link
Contributor

@TimmyExogenous TimmyExogenous commented Sep 10, 2024

Description

The unjail operation will fail because the input chainID isn't ChainIDWithoutRevision, which results in an incorrect dogfood AVS address being generated.

Summary by CodeRabbit

  • New Features

    • Improved clarity in function parameters related to chain ID processing by renaming to reflect the exclusion of revision information.
  • Bug Fixes

    • Enhanced error messaging for unknown chain IDs to provide clearer feedback.
  • Chores

    • Updated the curl package version in Dockerfiles to ensure the use of a more recent version, potentially introducing bug fixes or new features.

Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

The changes involve updates to the Delegation function in the Keeper struct of the impl_sdk.go file and several method signatures in the usd_value.go file. Key modifications include altering how the chain ID is processed by excluding revision information and renaming parameters for clarity. Additionally, the Dockerfile and Exocore Dockerfile were updated to use a newer version of the curl package. These adjustments enhance parameter understanding and ensure the use of more recent dependencies.

Changes

Files Change Summary
x/dogfood/keeper/impl_sdk.go Modified the Delegation function to use avstypes.ChainIDWithoutRevision(ctx.ChainID()) instead of ctx.ChainID().
x/operator/keeper/usd_value.go Renamed parameters in multiple functions to chainIDWithoutRevision for clarity while maintaining existing logic.
Dockerfile, networks/local/exocore/Dockerfile Updated curl package version from 8.9.0-r0 to 8.9.1-r0.

Poem

🐇 In the code where changes bloom,
A clearer path begins to loom.
With revisions shed, we hop along,
To keep our logic clear and strong.
So here’s to the new, let’s celebrate,
In code we trust, it’s never too late! 🎉

Tip

New review model

We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.


New features

Walkthrough comment now includes:

  • Possibly related PRs: A list of potentially related PRs to help you recall past context.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs. You can also provide custom labeling instructions in the UI or configuration file.

Notes:

  • Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7f05dad and 2b50cdd.

Files selected for processing (2)
  • x/dogfood/keeper/impl_sdk.go (1 hunks)
  • x/operator/keeper/usd_value.go (3 hunks)
Additional comments not posted (4)
x/dogfood/keeper/impl_sdk.go (1)

149-149: LGTM, but verify the impact on delegation operations.

The change to exclude revision information from the chain ID when retrieving or calculating operator USD values is approved.

However, ensure that this change is thoroughly tested to confirm that it behaves as expected and does not introduce any unintended side effects or bugs related to the delegation operations, particularly in scenarios where the revision aspect of the chain ID is significant.

Run the following script to verify the delegation operations:

x/operator/keeper/usd_value.go (3)

232-236: LGTM!

The change to rename the parameter chainID to chainIDWithoutRevision in the GetVotePowerForChainID function is approved.

This enhances clarity regarding the nature of the chain ID being processed, indicating that it does not include revision information. The accompanying update to the error message when the chain ID is determined to be unknown aligns with this change.


253-256: LGTM!

The change to rename the parameter chainID to chainIDWithoutRevision in the GetOperatorAssetValue function is approved.

This enhances clarity regarding the nature of the chain ID being processed, indicating that it does not include revision information. The accompanying update to the error message when the chain ID is determined to be unknown aligns with this change.


348-352: LGTM!

The change to rename the parameter chainID to chainIDWithoutRevision in the GetOrCalculateOperatorUSDValues function is approved.

This enhances clarity regarding the nature of the chain ID being processed, indicating that it does not include revision information. The accompanying update to the error message when the chain ID is determined to be unknown aligns with this change.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2b50cdd and a7b2d57.

Files selected for processing (2)
  • Dockerfile (1 hunks)
  • networks/local/exocore/Dockerfile (1 hunks)
Files skipped from review due to trivial changes (2)
  • Dockerfile
  • networks/local/exocore/Dockerfile

Copy link
Contributor

@bwhour bwhour left a comment

Choose a reason for hiding this comment

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

it looks good.

@cloud8little
Copy link
Contributor

Test passed. successfully sending a unjail tx.

 exocored tx slashing unjail --from v4  --home ~/.testnetV4/node4 --node xotp://localhost:20000 --gas-prices 7ae
Enter keyring passphrase (attempt 1/3):
auth_info:
  fee:
    amount:
    - amount: "1400000"
      denom: aexo
    gas_limit: "200000"
    granter: ""
    payer: ""
  signer_infos: []
  tip: null
body:
  extension_options: []
  memo: ""
  messages:
  - '@type': /cosmos.slashing.v1beta1.MsgUnjail
    validator_addr: exovaloper1uw7n7xqxj2hmk5dlw92as6s7se5mmkafjj53zs
  non_critical_extension_options: []
  timeout_height: "0"
signatures: []
confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
events: []
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: 5F1FE118A998A9730E428D501D994BE2F982F597A3BEF159B985BD8F5BEF760F

exocored q tx 5F1FE118A998A9730E428D501D994BE2F982F597A3BEF159B985BD8F5BEF760F --node http://localhost:20000
code: 0
codespace: ""
data: 122C0A2A2F636F736D6F732E736C617368696E672E763162657461312E4D7367556E6A61696C526573706F6E7365
events:
- attributes:
  - index: true
    key: spender
    value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982
  - index: true
    key: amount
    value: 1400000aexo
  type: coin_spent
- attributes:
  - index: true
    key: receiver
    value: exo17xpfvakm2amg962yls6f84z3kell8c5lgqz40d
  - index: true
    key: amount
    value: 1400000aexo
  type: coin_received
- attributes:
  - index: true
    key: recipient
    value: exo17xpfvakm2amg962yls6f84z3kell8c5lgqz40d
  - index: true
    key: sender
    value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982
  - index: true
    key: amount
    value: 1400000aexo
  type: transfer
- attributes:
  - index: true
    key: sender
    value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982
  type: message
- attributes:
  - index: true
    key: fee
    value: 1400000aexo
  - index: true
    key: fee_payer
    value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982
  type: tx
- attributes:
  - index: true
    key: acc_seq
    value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982/3
  type: tx
- attributes:
  - index: true
    key: signature
    value: z11o01H+JBFx/wKtrKNlw8tlhOfhrzvrTOAlFV4P65EF9YdmIl6gMLy9kprvZ22b7Ubusjd7iykllMLi/gb3YgE=
  type: tx
- attributes:
  - index: true
    key: action
    value: /cosmos.slashing.v1beta1.MsgUnjail
  - index: true
    key: sender
    value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982
  - index: true
    key: module
    value: slashing
  type: message
gas_used: "110362"
gas_wanted: "200000"
height: "7329914"
info: ""
logs:
- events:
  - attributes:
    - key: action
      value: /cosmos.slashing.v1beta1.MsgUnjail
    - key: sender
      value: exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982
    - key: module
      value: slashing
    type: message
  log: ""
  msg_index: 0
raw_log: '[{"msg_index":0,"events":[{"type":"message","attributes":[{"key":"action","value":"/cosmos.slashing.v1beta1.MsgUnjail"},{"key":"sender","value":"exo1uw7n7xqxj2hmk5dlw92as6s7se5mmkafuwx982"},{"key":"module","value":"slashing"}]}]}]'
timestamp: "2024-09-10T07:50:14Z"
tx:
  '@type': /cosmos.tx.v1beta1.Tx
  auth_info:
    fee:
      amount:
      - amount: "1400000"
        denom: aexo
      gas_limit: "200000"
      granter: ""
      payer: ""
    signer_infos:
    - mode_info:
        single:
          mode: SIGN_MODE_DIRECT
      public_key:
        '@type': /ethermint.crypto.v1.ethsecp256k1.PubKey
        key: AxRlmeiq/Weeay4b6VU6hYSitXX1iTrpZ5y9ekGkjhDn
      sequence: "3"
    tip: null
  body:
    extension_options: []
    memo: ""
    messages:
    - '@type': /cosmos.slashing.v1beta1.MsgUnjail
      validator_addr: exovaloper1uw7n7xqxj2hmk5dlw92as6s7se5mmkafjj53zs
    non_critical_extension_options: []
    timeout_height: "0"
  signatures:
  - z11o01H+JBFx/wKtrKNlw8tlhOfhrzvrTOAlFV4P65EF9YdmIl6gMLy9kprvZ22b7Ubusjd7iykllMLi/gb3YgE=
txhash: 5F1FE118A998A9730E428D501D994BE2F982F597A3BEF159B985BD8F5BEF760F

@TimmyExogenous TimmyExogenous merged commit 48e3799 into ExocoreNetwork:develop Sep 10, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants