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

EVM: Pad output of resolve_address #1005

Merged
merged 1 commit into from
Jan 10, 2023
Merged

EVM: Pad output of resolve_address #1005

merged 1 commit into from
Jan 10, 2023

Conversation

mriise
Copy link
Contributor

@mriise mriise commented Jan 10, 2023

No description provided.

@codecov-commenter
Copy link

Codecov Report

Merging #1005 (ee95b31) into next (56339c2) will increase coverage by 2.86%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #1005      +/-   ##
==========================================
+ Coverage   85.56%   88.43%   +2.86%     
==========================================
  Files         127      127              
  Lines       24032    23574     -458     
==========================================
+ Hits        20564    20847     +283     
+ Misses       3468     2727     -741     
Impacted Files Coverage Δ
actors/evm/src/interpreter/precompiles/fvm.rs 66.90% <0.00%> (+13.72%) ⬆️
test_vm/src/lib.rs 79.85% <0.00%> (-0.47%) ⬇️
actors/miner/src/lib.rs 82.98% <0.00%> (+0.13%) ⬆️
state/src/check.rs 86.35% <0.00%> (+0.26%) ⬆️
actors/power/src/lib.rs 84.05% <0.00%> (+0.43%) ⬆️
actors/evm/src/lib.rs 85.78% <0.00%> (+0.47%) ⬆️
actors/evm/src/interpreter/stack.rs 93.52% <0.00%> (+2.15%) ⬆️
actors/evm/src/interpreter/instructions/call.rs 82.51% <0.00%> (+13.21%) ⬆️
actors/miner/src/deadline_info.rs 96.62% <0.00%> (+16.85%) ⬆️
... and 6 more

Comment on lines 118 to +119
/// Read BE encoded low u64 ID address from a u256 word
/// Looks up and returns the encoded f4 addresses of an ID address, returning empty array if not found
/// Looks up and returns the encoded f4 addresses of an ID address. Empty array if not found or `InvalidInput` input was larger 2^64.
Copy link
Member

Choose a reason for hiding this comment

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

Is this the final form of the docs? They look a little bit unstructured. Would suggest to:

  1. Explain what these methods do on a conceptual level.
  2. Then specify the call layout in a way similar to what I did in FIP-0054.
  3. Then specify the return value.
  4. Then specify the errors.

Can fix in a follow-up PR.

Copy link
Contributor Author

@mriise mriise Jan 12, 2023

Choose a reason for hiding this comment

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

Issue that covers this: filecoin-project/ref-fvm#1432

/// returns BE encoded u64 or empty array if nothing found
/// Reads a FIL encoded address.
/// Resolves a FIL encoded address into an ID address.
/// Returns BE encoded u256 (return will always be under 2^64). Empty array if nothing found or `InvalidInput` if length was larger 2^32.
Copy link
Member

Choose a reason for hiding this comment

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

Since we mix up two forms of padding (right padding and left padding) in the precompiles, it wouldn't hurt to specify which kind of padding we use here (left/natural padding).

Copy link
Contributor Author

@mriise mriise Jan 10, 2023

Choose a reason for hiding this comment

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

will fix in follow up PR to get @emmanuelm41 unblocked ASAP

@mriise mriise merged commit 84383b7 into next Jan 10, 2023
@mriise mriise deleted the fix/resolve-addr-padding branch January 10, 2023 16:05
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.

EVM: Precompile output encoding is inconsistient for small values
3 participants