-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fevm: address #9617 review comments (FEVM nv18 merge) #9984
Merged
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c336dab
add a network version gate to IsValidForSending.
raulk 6e2d463
consolidate signature validation logic.
raulk bd6bc83
consolidate signature validation logic.
raulk 285e33b
cleanup.
raulk 65e43d9
adjust IsValidSecpkSigType and usages.
raulk 90cade7
{predictable=>delegated} addresses.
raulk 08b978c
add link to TODO issue.
raulk a3ee54f
strengthen assertions in TestEthNewPendingTransactionFilter.
raulk 06b570d
move EthAddressFromPubKey to chain/types/ethtypes.
raulk f021156
fix typos.
raulk e203144
constant for Event AMT bitwidth.
raulk a4bf2e8
update genesis logic to create Eth Null Addresses as EthAccounts.
raulk f1677ba
{Delegated=>Deterministic} Address.
raulk 78bc214
go fmt + lint.
raulk 9e61d68
drop f099 eth_call hack.
raulk ace6efe
cli: fix Eth-related CLI (+).
raulk 6088671
remove fmt.Println.
raulk 3162601
gen.
raulk b07fe47
fix test.
raulk 0f58018
fix comment.
raulk 4262f76
address review comments.
raulk 449a427
clear up error message.
raulk d30731e
use existing variable for empty object CID.
raulk bad5761
make gen.
raulk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package chain | ||
|
||
import ( | ||
"github.com/filecoin-project/go-address" | ||
"github.com/filecoin-project/go-state-types/crypto" | ||
"github.com/filecoin-project/lotus/chain/types" | ||
"github.com/filecoin-project/lotus/chain/types/ethtypes" | ||
"github.com/filecoin-project/lotus/lib/sigs" | ||
"golang.org/x/xerrors" | ||
) | ||
|
||
// AuthenticateMessage authenticates the message by verifying that the supplied | ||
// SignedMessage was signed by the indicated Address, computing the correct | ||
// signature payload depending on the signature type. The supplied Address type | ||
// must be recognized by the registered verifier for the signature type. | ||
func AuthenticateMessage(msg *types.SignedMessage, signer address.Address) error { | ||
var digest []byte | ||
|
||
switch typ := msg.Signature.Type; typ { | ||
case crypto.SigTypeDelegated: | ||
txArgs, err := ethtypes.NewEthTxArgsFromMessage(&msg.Message) | ||
if err != nil { | ||
return xerrors.Errorf("failed to reconstruct eth transaction: %w", err) | ||
} | ||
msg, err := txArgs.ToRlpUnsignedMsg() | ||
if err != nil { | ||
return xerrors.Errorf("failed to repack eth rlp message: %w", err) | ||
} | ||
digest = msg | ||
default: | ||
digest = msg.Message.Cid().Bytes() | ||
} | ||
|
||
if err := sigs.Verify(&msg.Signature, signer, digest); err != nil { | ||
return xerrors.Errorf("secpk message %s has invalid signature: %w", msg.Cid(), err) | ||
} | ||
return nil | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessarily secp here