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

[Refactoring] A global empty hash variables #142

Open
hyunsooda opened this issue Nov 25, 2024 · 2 comments
Open

[Refactoring] A global empty hash variables #142

hyunsooda opened this issue Nov 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@hyunsooda
Copy link
Contributor

Is your request related to a problem? Please describe.
There are so many scattered literal strings of empty hash in the existing Kaia codebase and following PRs in the future.

  • Empty code hash
  • Empty root hash

Describe the solution you'd like
Refactoring.
We can define a types package and reuse it.

Describe alternatives you've considered

Additional context
If you look fine with this refactoring, let me proceed with it

@hyunsooda hyunsooda added the enhancement New feature or request label Nov 25, 2024
@blukat29
Copy link
Contributor

Nice spot. We could do something like https://github.com/ethereum/go-ethereum/blob/master/core/types/hashes.go

@blukat29
Copy link
Contributor

blukat29 commented Nov 25, 2024

There are other similar variables https://github.com/kaiachain/kaia/blob/dev/blockchain/types/derivesha/derive_sha_test.go.
We could name them like EmptyTxRootSimple. Same 0x56 and 0xc5 values, but different usages under different names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants