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

[Flow EVM] return empty string when deployed address is empty #5456

Merged

Conversation

ramtinms
Copy link
Member

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 57.47%. Comparing base (49aabc9) to head (58b189e).

Files Patch % Lines
fvm/evm/types/address.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5456      +/-   ##
==========================================
+ Coverage   56.02%   57.47%   +1.44%     
==========================================
  Files        1026      848     -178     
  Lines       99940    84400   -15540     
==========================================
- Hits        55990    48507    -7483     
+ Misses      39661    32112    -7549     
+ Partials     4289     3781     -508     
Flag Coverage Δ
unittests 57.47% <50.00%> (+1.44%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if fa == EmptyAddress {
return ""
}
return hex.EncodeToString(fa[:])
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we maybe change this to:

return fa.ToCommon().Hex()

?
The difference being that the latter returns the check-summed variant, e.g.:
from: 99466ed2e37b892a2ee3e9cd55a98b68f5735db2
to: 0x99466ED2E37B892A2Ee3E9CD55a98b68f5735db2

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: I also made a change in #5416, which I guess is conflicting.

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea, I'll use your changes, but I think the issue is still the empty address, it would result in growth in all events.

Copy link
Member Author

Choose a reason for hiding this comment

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

now that I'm looking into it, the checksum is a post-process only input-dependent, not sure if it makes sense to do it on-chain and not off-chain later?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the empty address should be omitted and simply return a ""

now that I'm looking into it, the checksum is a post-process only input-dependent, not sure if it makes sense to do it on-chain and not off-chain later?

That's true, I only mentioned to have it check-summed in the event payload, to showcase its validity. It is something that can be done off-chain as well though. It does not make a difference.

@ramtinms ramtinms added this pull request to the merge queue Feb 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2024
@ramtinms ramtinms added this pull request to the merge queue Feb 26, 2024
Merged via the queue into master with commit c912767 Feb 26, 2024
50 of 51 checks passed
@ramtinms ramtinms deleted the ramtin/flow-evm-dont-returne-address-zero-for-deployment branch February 26, 2024 22:29
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.

5 participants