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: removed chainId field for legacy EIP155 transactions (#2468) #2489

Merged
merged 3 commits into from
May 16, 2024

Conversation

quiet-node
Copy link
Member

Description:
This PR simply remove the chainId field if the transaction result is a legacy EIP155 transaction whose chainId equals to "0x".

Related issue(s):

Fixes #2468

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@quiet-node quiet-node requested a review from AlfredoG87 as a code owner May 13, 2024 22:51
@quiet-node quiet-node linked an issue May 13, 2024 that may be closed by this pull request
@quiet-node quiet-node requested review from ebadiere, Nana-EC, a team and lukelee-sl as code owners May 13, 2024 22:51
@quiet-node quiet-node self-assigned this May 13, 2024
Copy link

github-actions bot commented May 13, 2024

Tests

    2 files  147 suites   13s ⏱️
820 tests 819 ✔️ 1 💤 0
832 runs  831 ✔️ 1 💤 0

Results for commit 30db1d9.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 13, 2024

Acceptance Tests

     26 files     305 suites   37m 21s ⏱️
   583 tests    573 ✔️ 3 💤   7
1 202 runs  1 183 ✔️ 3 💤 16

Results for commit 30db1d9.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Looks good.
Nice acceptance tests but there's a missing unit test.

@@ -147,7 +147,7 @@ const formatContractResult = (cr: any) => {
const commonFields = {
blockHash: toHash32(cr.block_hash),
blockNumber: nullableNumberTo0x(cr.block_number),
chainId: cr.chain_id,
chainId: cr.chain_id === '0x' ? undefined : cr.chain_id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing UT

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

AlfredoG87
AlfredoG87 previously approved these changes May 14, 2024
Copy link
Collaborator

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM

@quiet-node quiet-node marked this pull request as draft May 14, 2024 18:45
@quiet-node quiet-node marked this pull request as ready for review May 14, 2024 19:16
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
@quiet-node quiet-node force-pushed the 2468-wrong-formatting-of-pre-eip155-transactions branch from c7ebc0e to 3be64cf Compare May 14, 2024 19:19
@quiet-node quiet-node requested review from Nana-EC and AlfredoG87 May 14, 2024 20:35
ebadiere
ebadiere previously approved these changes May 15, 2024
Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

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

LG.

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG. One nit on comment

@@ -147,7 +147,7 @@ const formatContractResult = (cr: any) => {
const commonFields = {
blockHash: toHash32(cr.block_hash),
blockNumber: nullableNumberTo0x(cr.block_number),
chainId: cr.chain_id,
chainId: cr.chain_id === EMPTY_HEX ? undefined : cr.chain_id,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: add a comment on what this does and why so other devs understand

Nana-EC
Nana-EC previously approved these changes May 15, 2024
Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
@quiet-node quiet-node dismissed stale reviews from Nana-EC and ebadiere via 30db1d9 May 15, 2024 17:02
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Collaborator

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM

@quiet-node quiet-node merged commit 1ca66cf into main May 16, 2024
32 of 33 checks passed
@quiet-node quiet-node deleted the 2468-wrong-formatting-of-pre-eip155-transactions branch May 16, 2024 13:56
quiet-node added a commit that referenced this pull request May 21, 2024
)

* fix: removed chainId field for legacy EIP155 transactions

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>

* test: added UT

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>

* chore: added explanation

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>

---------

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
@quiet-node quiet-node mentioned this pull request May 21, 2024
2 tasks
quiet-node added a commit that referenced this pull request May 21, 2024
fix: removed chainId field for legacy EIP155 transactions (#2468) (#2489)

* fix: removed chainId field for legacy EIP155 transactions



* test: added UT



* chore: added explanation



---------

Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
@quiet-node quiet-node added the enhancement New feature or request label May 23, 2024
@quiet-node quiet-node added this to the 0.48.0 milestone May 23, 2024
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

Successfully merging this pull request may close these issues.

Wrong formatting of pre-EIP155 transactions
4 participants