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

Configure the cosmos SDK with correct account prefix #22

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

adshmh
Copy link
Contributor

@adshmh adshmh commented Aug 17, 2024

Summary

The SDK needs to configure the Cosmos SDK with correct account prefix, i.e. "pokt".

Issue

Without this fix, validating the relay response fails:

if err := relayResponse.ValidateBasic(); err != nil {

This is because the session header validation would fail if the account prefix is not set to "pokt":

Relay response validation checking the session header:

image

Session Header validation checking the account is in Bech32 with correct prefix:

https://github.com/pokt-network/poktroll/blob/e5024ea5d28cc94d09e531f84701a85cefb9d56f/x/session/types/session_header.go#L11

NOTE

This is copied (after removing unnecessary settings) from https://github.com/pokt-network/poktroll/blob/e5024ea5d28cc94d09e531f84701a85cefb9d56f/cmd/poktrolld/cmd/config.go#L21

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (specify)

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

@adshmh adshmh added the bug Something isn't working label Aug 17, 2024
@adshmh adshmh self-assigned this Aug 17, 2024
@adshmh adshmh requested a review from red-0ne August 17, 2024 11:42
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

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

Preemtively approving. Let's be consistent by updating all the prefixes.

relay.go Outdated Show resolved Hide resolved
@adshmh adshmh merged commit b7f3843 into main Aug 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants