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

Bug fixes for endianness between boundaries #2329

Merged
merged 65 commits into from
Aug 18, 2023
Merged

Conversation

sieniven
Copy link
Member

@sieniven sieniven commented Aug 15, 2023

Summary

  • Fixes to inconsistencies in converting to U256 type on Rust to pass by u64 instead between cross boundaries.
  • Fixes to all inconsistencies in converting to H256 type on Rust to pass hashes by strings instead.
  • All EVM sender addresses on consensus and on miner will now be indexed with the sender address which is in string type.
  • When passing hash values into EVM side, we will convert them from Rust string types.
  • When passing hash values into DVM side, we will convert them from strings to BTC internal hash representation, which is stored in little endian.

Context

  1. Rust U256:
  • From: takes a big endian byte array, stores as little endian.
  • To: outputs a big endian byte array.
  1. BTC U256:
  • Stored as little endian, with the exception of Witness16EthHash
  • GetByteArray returns byte array in big endian.

Implications

  • Storage

    • Database reindex required
    • Database reindex optional
    • Database reindex not required
    • None
  • Consensus

    • Network upgrade required
    • Includes backward compatible changes
    • Includes consensus workarounds
    • Includes consensus refactors
    • None

@sieniven sieniven changed the title Bug fixes to little endianness on dvm Bug fixes for endianness between boundaries Aug 15, 2023
@sieniven sieniven marked this pull request as ready for review August 15, 2023 15:56
@Jouzo Jouzo mentioned this pull request Aug 16, 2023
2 tasks
@prasannavl prasannavl merged commit 28044c6 into master Aug 18, 2023
10 of 13 checks passed
@prasannavl prasannavl deleted the evm/fix-endianness branch August 18, 2023 09:10
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.

3 participants