Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions hermes/src/network/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import (
"strings"
"time"

"net/http"
_ "net/http/pprof"

"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/host"
Expand All @@ -55,6 +58,11 @@ func RegisterObservationCallback(f C.callback_t, network_id, bootstrap_addrs, li
bootstrapAddrs := strings.Split(C.GoString(bootstrap_addrs), ",")
listenAddrs := strings.Split(C.GoString(listen_addrs), ",")

// Bind pprof to 6060 for debugging Go code.
go func() {
http.ListenAndServe("127.0.0.1:6060", nil)
}()

var startTime int64
var recoverRerun func()

Expand Down
6 changes: 3 additions & 3 deletions hermes/src/store/proof/wormhole_merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use {
pythnet_sdk::{
accumulators::{
merkle::{
MerkleAccumulator,
MerklePath,
MerkleTree,
},
Accumulator,
},
Expand Down Expand Up @@ -84,12 +84,12 @@ pub fn construct_message_states_proofs(

// Check whether the state is valid
let merkle_acc =
match MerkleAccumulator::<Keccak160>::from_set(raw_messages.iter().map(|m| m.as_ref())) {
match MerkleTree::<Keccak160>::from_set(raw_messages.iter().map(|m| m.as_ref())) {
Some(merkle_acc) => merkle_acc,
None => return Ok(vec![]), // It only happens when the message set is empty
};

if merkle_acc.root != wormhole_merkle_state.root.root {
if merkle_acc.root.as_bytes() != wormhole_merkle_state.root.root {
return Err(anyhow!("Invalid merkle root"));
}

Expand Down