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

Problem: query blocks before enable feemarket module get nil pointer … #485

Closed
wants to merge 4 commits into from

Conversation

mmsqe
Copy link
Collaborator

@mmsqe mmsqe commented May 14, 2024

…error

Closes: #XXX

Description


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

For admin use:

  • Added appropriate labels to PR (ex. WIP, R4R, docs, etc)
  • Reviewers assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

Copy link

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 22.22222% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 61.52%. Comparing base (179e436) to head (6f2285b).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #485      +/-   ##
===========================================
- Coverage    61.53%   61.52%   -0.02%     
===========================================
  Files          127      127              
  Lines         9477     9484       +7     
===========================================
+ Hits          5832     5835       +3     
- Misses        3107     3113       +6     
+ Partials       538      536       -2     
Files Coverage Δ
x/feemarket/keeper/params.go 72.41% <100.00%> (+10.34%) ⬆️
x/feemarket/types/params.go 70.09% <0.00%> (-4.91%) ⬇️

@mmsqe mmsqe marked this pull request as ready for review May 14, 2024 02:22
@mmsqe mmsqe requested a review from yihuang May 14, 2024 02:22
bz := ctx.KVStore(k.storeKey).Get(types.ParamsKey)
if len(bz) == 0 {
k.ss.GetParamSetIfExists(ctx, &params)
// avoid nil pointers when params are not set
params.FillDefaults()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

actually it's panic from store.parent.Get before get from subspace

Copy link
Collaborator

Choose a reason for hiding this comment

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

why parent get will have panic?

Copy link
Collaborator Author

@mmsqe mmsqe May 14, 2024

Choose a reason for hiding this comment

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

since store is nil when query on old block, the passed parent is nil

Copy link
Collaborator

@yihuang yihuang May 14, 2024

Choose a reason for hiding this comment

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

the store won't be nil if it's registered in the binary, just the data could be missing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

when query old version, cacheStore will be nil right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, that makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess if we have this: crypto-org-chain/cosmos-sdk#435, we don't need this?

@mmsqe mmsqe closed this May 16, 2024
@mmsqe mmsqe deleted the nil_pointer branch August 16, 2024 07:16
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.

None yet

2 participants