-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ACP-77: Implement Warp message verification (#3423)
- Loading branch information
1 parent
3696d68
commit 1c4a510
Showing
10 changed files
with
641 additions
and
24 deletions.
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
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,36 @@ | ||
// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
|
||
package executor | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/ava-labs/avalanchego/snow/validators" | ||
"github.com/ava-labs/avalanchego/vms/platformvm/block" | ||
"github.com/ava-labs/avalanchego/vms/platformvm/txs/executor" | ||
) | ||
|
||
// VerifyWarpMessages verifies all warp messages in the block. If any of the | ||
// warp messages are invalid, an error is returned. | ||
func VerifyWarpMessages( | ||
ctx context.Context, | ||
networkID uint32, | ||
validatorState validators.State, | ||
pChainHeight uint64, | ||
b block.Block, | ||
) error { | ||
for _, tx := range b.Txs() { | ||
err := executor.VerifyWarpMessages( | ||
ctx, | ||
networkID, | ||
validatorState, | ||
pChainHeight, | ||
tx.Unsigned, | ||
) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
return nil | ||
} |
Oops, something went wrong.