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: delegated signatures: check every field of txs and roundtrip eth <-> FIL #10007

Merged
merged 2 commits into from
Jan 14, 2023

Conversation

arajasek
Copy link
Contributor

@arajasek arajasek commented Jan 14, 2023

Related Issues

filecoin-project/ref-fvm#1433

Proposed Changes

  • Make EthTxArgsFromMessage much stricter
  • Roundtrip Eth <-> FIL messages during siggy validation

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@arajasek arajasek requested a review from a team as a code owner January 14, 2023 00:36
@arajasek arajasek changed the title fix: delegated signatures: check every field of txs and roundtrip eth < fix: delegated signatures: check every field of txs and roundtrip eth <-> FIL Jan 14, 2023
Params: params,
}, nil
}

func (tx *EthTxArgs) ToSignedMessage() (*types.SignedMessage, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, I didn't notice the method right after this one does the same thing. We'll need to either consolidate these methods or drop the new one before merging.

@arajasek
Copy link
Contributor Author

I'd like to write tests covering a lot of the edge-cases (eg. bad Version, bad params), but I'm not sure whether that should block landing this PR.

return EthTxArgs{}, err
return EthTxArgs{}, xerrors.Errorf("failed to read params byte array: %w", err)
}

Copy link
Member

Choose a reason for hiding this comment

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

We need to assert that params is non-empty here. Otherwise, this should have been a method send and someone pulled a fast one.

@Stebalien Stebalien enabled auto-merge (squash) January 14, 2023 04:15
@arajasek arajasek merged commit cc86117 into release/v1.20.0 Jan 14, 2023
@arajasek arajasek deleted the asr/delegated-siggy branch January 14, 2023 05:14
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.

2 participants