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(sdk): accept blocks where coinbase is null (e.g. pending block) #509

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

mask-pp
Copy link

@mask-pp mask-pp commented Sep 12, 2023

1. Purpose or design rationale of this PR

  • Appear error when getting a pending block, due to coinbase field is null.
  • keep consistent with the behavior of the latest version of go-ethereum.

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

Copy link
Member

@colinlyguo colinlyguo left a comment

Choose a reason for hiding this comment

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

Does this modification mean the header would not have the miner field?

@mask-pp
Copy link
Author

mask-pp commented Sep 12, 2023

Does this modification mean the header would not have the miner field?

Modified to be compatible with the case where the miner value is empty. And keep consistent with the behavior of the latest version of go-ethereum.

@colinlyguo
Copy link
Member

Does this modification mean the header would not have the miner field?

Modified to be compatible with the case where the miner value is empty. And keep consistent with the behavior of the latest version of go-ethereum.

o i c.

@Thegaram Thegaram changed the title fix error(when get pengding block) coinbase address is null fix(sdk): accept blocks where coinbase is null (e.g. pending block) Sep 12, 2023
Thegaram
Thegaram previously approved these changes Sep 12, 2023
Copy link

@Thegaram Thegaram left a comment

Choose a reason for hiding this comment

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

Acceptable way to fix but the proper way would be to remove gencodec:"required" inside block.go

@mask-pp
Copy link
Author

mask-pp commented Sep 12, 2023

Acceptable way to fix but the proper way would be to remove gencodec:"required" inside block.go

Remove gencodec:"required" inside block.go and run gencodec -type Header -field-override headerMarshaling -out gen_header_json.go is the right way.

@mask-pp mask-pp merged commit 417dd02 into develop Sep 13, 2023
5 checks passed
@mask-pp mask-pp deleted the feat/fix_bug_header_coinbase branch September 13, 2023 09:00
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

3 participants