Skip to content

Commit

Permalink
Message id updates (#225)
Browse files Browse the repository at this point in the history
* update packing and subnet-evm version

* calculate message id output
  • Loading branch information
minghinmatthewlam authored Jan 8, 2024
1 parent cd289b2 commit f03f526
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
26 changes: 24 additions & 2 deletions abi-bindings/go/Teleporter/TeleporterMessenger/packing.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,35 @@ func PackReceiveCrossChainMessage(messageIndex uint32, relayerRewardAddress comm
return abi.Pack("receiveCrossChainMessage", messageIndex, relayerRewardAddress)
}

// PackCalculateMessageID packs input to form a call to the calculateMessageID function
func PackCalculateMessageID(
sourceBlockchainID [32]byte,
destinationBlockchainID [32]byte,
nonce *big.Int) ([]byte, error) {
abi, err := TeleporterMessengerMetaData.GetAbi()
if err != nil {
return nil, errors.Wrap(err, "failed to get abi")
}

return abi.Pack("calculateMessageID", sourceBlockchainID, destinationBlockchainID, nonce)
}

func PackCalculateMessageIDOutput(messageID [32]byte) ([]byte, error) {
abi, err := TeleporterMessengerMetaData.GetAbi()
if err != nil {
return nil, errors.Wrap(err, "failed to get abi")
}

return abi.PackOutput("calculateMessageID", messageID)
}

// PackMessageReceived packs a MessageReceivedInput to form a call to the messageReceived function
func PackMessageReceived(originChainID ids.ID, messageID *big.Int) ([]byte, error) {
func PackMessageReceived(messageID [32]byte) ([]byte, error) {
abi, err := TeleporterMessengerMetaData.GetAbi()
if err != nil {
return nil, errors.Wrap(err, "failed to get abi")
}
return abi.Pack("messageReceived", originChainID, messageID)
return abi.Pack("messageReceived", messageID)
}

// UnpackMessageReceivedResult attempts to unpack result bytes to a bool indicating whether the message was received
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/subnet-evm
Submodule subnet-evm updated 57 files
+0 −6 .github/CODEOWNERS
+3 −0 .github/workflows/ci.yml
+3 −2 README.md
+3 −3 cmd/simulator/key/key.go
+1 −1 cmd/simulator/load/funder.go
+107 −86 cmd/simulator/load/loader.go
+57 −18 cmd/simulator/load/worker.go
+88 −1 cmd/simulator/metrics/metrics.go
+1 −7 cmd/simulator/txs/agent.go
+37 −15 cmd/simulator/txs/tx_generator.go
+1 −0 compatibility.json
+1 −0 core/TrieStressTest.abi
+1 −0 core/TrieStressTest.bin
+22 −0 core/TrieStressTest.sol
+9 −3 core/predicate_check.go
+147 −10 core/predicate_check_test.go
+3 −8 core/state_processor.go
+115 −0 core/trie_stress_bench_test.go
+4 −0 eth/api_backend.go
+23 −1 eth/state_accessor.go
+14 −10 eth/tracers/api.go
+417 −0 eth/tracers/api_extra_test.go
+17 −109 eth/tracers/api_test.go
+5 −6 go.mod
+10 −13 go.sum
+11 −10 params/config.go
+16 −0 params/precompile_upgrade_test.go
+1 −1 params/state_upgrade_test.go
+4 −29 peer/client.go
+48 −44 peer/network.go
+20 −20 peer/network_test.go
+21 −7 peer/waiting_handler.go
+0 −1 plugin/evm/config.go
+0 −14 plugin/evm/service.go
+7 −8 plugin/evm/tx_gossip_test.go
+1 −1 plugin/evm/version.go
+4 −5 plugin/evm/vm.go
+0 −116 plugin/evm/vm_test.go
+117 −0 plugin/evm/vm_warp_test.go
+2 −2 precompile/precompileconfig/config.go
+2 −2 precompile/precompileconfig/mocks.go
+11 −33 precompile/testutils/test_predicate.go
+3 −3 scripts/build_image.sh
+15 −15 scripts/install_avalanchego_release.sh
+1 −5 scripts/run_ginkgo.sh
+28 −0 scripts/run_ginkgo_warp.sh
+1 −2 scripts/versions.sh
+22 −5 tests/utils/runner/network_manager.go
+583 −340 tests/warp/warp_test.go
+1 −2 warp/aggregator/aggregator.go
+1 −1 warp/backend.go
+6 −6 warp/client.go
+0 −9 warp/handlers/signature_request_test.go
+22 −11 warp/service.go
+5 −10 x/warp/README.md
+27 −42 x/warp/config.go
+72 −71 x/warp/predicate_test.go

0 comments on commit f03f526

Please sign in to comment.