Skip to content

Conversation

@iosh
Copy link
Collaborator

@iosh iosh commented Jun 1, 2025

Package Upgrades:

  • keccak-hash: 0.5 -> 0.11.0
  • rlp: 0.4 -> 0.6.1(Use forked version)
  • ethereum-types: 0.9 -> 0.15.1

** Changes **
parity-common/uint CHANGELOG#0.10.0

  • The function to_big_endian has been renamed to write_as_big_endian.
  • The function to_little_endian has been renamed to write_as_little_endian.
  • Usage of drain() has been replaced with as_raw().
  • Usage of as_slice() has been replaced with as_ref().
  • The conversion sig.r().into() has been updated to U256::from_big_endian(sig.r()) for explicit construction from big-endian bytes.
  • Updated the buffer type in push_msg_id_leb128_encoding from Vec<u8> to BytesMut.

This change is Reviewable

resolve #3239

BREAKING CHANGE:

The upgrade to rlp 0.6.1 :

Previous behavior:
True was often encoded as RLP 0x01.
False was often encoded as RLP 0x00.

New behavior:
True is encoded as RLP 0x01.
False is encoded as RLP 0x80 (representing an empty byte string).

You can see the RLP change here : https://github.com/paritytech/parity-common/pull/572

@iosh
Copy link
Collaborator Author

iosh commented Jun 1, 2025

retest this please

return False
elif serial == b'\x01':
return True
elif serial == b'':
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can see the RLP change here : https://github.com/paritytech/parity-common/pull/572

Copy link
Member

Choose a reason for hiding this comment

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

Done

@iosh
Copy link
Collaborator Author

iosh commented Jun 2, 2025

retest this please

2 similar comments
@iosh
Copy link
Collaborator Author

iosh commented Jun 2, 2025

retest this please

@iosh
Copy link
Collaborator Author

iosh commented Jun 2, 2025

retest this please

def test_get_tx_by_hash_errors(client: RpcClient):

assert_raises_rpc_error(
-32602,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove unnecessary error tests.

Copy link
Member

Choose a reason for hiding this comment

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

Done

Copy link
Member

@Pana Pana left a comment

Choose a reason for hiding this comment

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

  1. The "dir" crate also have a "ethereum-types" dependency, recommend update it too
  2. The rlp behaviour change seems is broken, seems this pr need a resync the data from genesis. we need figure a way to merge it

Reviewed 45 of 51 files at r1, 7 of 9 files at r2, 6 of 6 files at r3, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions


tests/conflux/messages.py line 65 at r3 (raw file):

)

# Copied from rlp.sedes.Boolean, but encode False to 0x00, not empty.

same here


integration_tests/conflux/messages.py line 65 at r3 (raw file):

)

# Copied from rlp.sedes.Boolean, but encode False to 0x00, not empty.

update the comment here

@iosh
Copy link
Collaborator Author

iosh commented Jun 4, 2025

retest this please

Copy link
Member

@Pana Pana left a comment

Choose a reason for hiding this comment

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

Reviewed 18 of 18 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @iosh)

def test_get_tx_by_hash_errors(client: RpcClient):

assert_raises_rpc_error(
-32602,
Copy link
Member

Choose a reason for hiding this comment

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

Done

return False
elif serial == b'\x01':
return True
elif serial == b'':
Copy link
Member

Choose a reason for hiding this comment

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

Done

Pana
Pana previously approved these changes Jun 4, 2025
Copy link
Member

@Pana Pana left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @iosh)

@Pana Pana requested review from ChenxingLi and peilun-conflux June 4, 2025 02:18
@Pana
Copy link
Member

Pana commented Jun 4, 2025

@peilun-conflux @ChenxingLi Please also help review this PR

Copy link
Contributor

@ChenxingLi ChenxingLi left a comment

Choose a reason for hiding this comment

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

Revert all changes related to rlp, put it in a separate PR. Read the issue #3254 for the details related to rlp.

Reviewed 22 of 51 files at r1, 7 of 18 files at r4.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @peilun-conflux)

@iosh
Copy link
Collaborator Author

iosh commented Jun 11, 2025

retest this please

@iosh iosh force-pushed the ethereum-types branch from e20ab63 to 153dbe3 Compare June 11, 2025 14:22
Copy link
Member

@Pana Pana left a comment

Choose a reason for hiding this comment

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

Reviewed 12 of 25 files at r5, 5 of 9 files at r6, 1 of 13 files at r7, 5 of 11 files at r9, 11 of 11 files at r10, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @peilun-conflux)


tools/consensus_bench/Cargo.toml line 20 at r10 (raw file):

[patch.crates-io]
rlp = { git = "https://github.com/Conflux-Chain/parity-common-rocksdb.git", rev = "b28832745c952c8bcac88348276b283c26de776a", package = "rlp" }

features is required


tools/evm-spec-tester/Cargo.toml line 41 at r10 (raw file):

[patch.crates-io]
rlp = { git = "https://github.com/Conflux-Chain/parity-common-rocksdb.git", rev = "b28832745c952c8bcac88348276b283c26de776a", package = "rlp" }

features is required


Cargo.toml line 428 at r10 (raw file):

# parity crates
# The fork of the rlp crate adds a legacy v0.4.x boolean encoding to the v0.6.x
rlp = { git = "https://github.com/Conflux-Chain/parity-common-rocksdb.git", rev = "b28832745c952c8bcac88348276b283c26de776a", package = "rlp", features = [

since you use the patch feature, no need update it here, you can move the comment to patch part


Cargo.toml line 461 at r10 (raw file):

[patch.crates-io]
sqlite3-sys = { git = "https://github.com/Conflux-Chain/sqlite3-sys.git", rev = "1de8e5998f7c2d919336660b8ef4e8f52ac43844" }
rlp = { git = "https://github.com/Conflux-Chain/parity-common-rocksdb.git", rev = "b28832745c952c8bcac88348276b283c26de776a", package = "rlp" }

features is required here

Copy link
Collaborator Author

@iosh iosh left a comment

Choose a reason for hiding this comment

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

Reviewable status: 70 of 71 files reviewed, 4 unresolved discussions (waiting on @Pana and @peilun-conflux)


Cargo.toml line 428 at r10 (raw file):

Previously, Pana (Pana) wrote…

since you use the patch feature, no need update it here, you can move the comment to patch part

The patch does not allow use feature.


Cargo.toml line 461 at r10 (raw file):

Previously, Pana (Pana) wrote…

features is required here

Same here.


tools/consensus_bench/Cargo.toml line 20 at r10 (raw file):

Previously, Pana (Pana) wrote…

features is required

Same here.


tools/evm-spec-tester/Cargo.toml line 41 at r10 (raw file):

Previously, Pana (Pana) wrote…

features is required

Same here.

Pana
Pana previously approved these changes Jun 12, 2025
Copy link
Member

@Pana Pana left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r11, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @peilun-conflux)

@iosh
Copy link
Collaborator Author

iosh commented Jun 12, 2025

retest this please

@iosh
Copy link
Collaborator Author

iosh commented Jun 26, 2025

Add two new custom types, CompatibleBool and LegacyBool, with custom encoding and decoding implementations. LegacyBool adheres to the decoding rules of RLP versions prior to 0.5, while CompatibleBool follows the rules for RLP version 0.5 and above, accepting 0x00 as false during decoding.

@iosh iosh requested review from ChenxingLi and Pana June 26, 2025 01:23
Pana
Pana previously approved these changes Jun 26, 2025
Copy link
Member

@Pana Pana left a comment

Choose a reason for hiding this comment

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

Reviewed 57 of 57 files at r12, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ChenxingLi and @peilun-conflux)

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.

Upgrade ethereum-types to latest version 0.15

3 participants