diff --git a/bridge/pkg/processor/message.go b/bridge/pkg/processor/message.go index 2301c53f..cbe3bc0e 100644 --- a/bridge/pkg/processor/message.go +++ b/bridge/pkg/processor/message.go @@ -22,14 +22,14 @@ var ( Name: "wormhole_lockups_observed_total", Help: "Total number of lockups received on-chain", }, - []string{"source_chain", "target_chain"}) + []string{"emitter_chain"}) lockupsSignedTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "wormhole_lockups_signed_total", Help: "Total number of lockups that were successfully signed", }, - []string{"source_chain", "target_chain"}) + []string{"emitter_chain"}) ) func init() { @@ -64,6 +64,7 @@ func (p *Processor) handleLockup(ctx context.Context, k *common.MessagePublicati EmitterChain: k.EmitterChain, EmitterAddress: k.EmitterAddress, Payload: k.Payload, + Sequence: k.Sequence, } // Generate digest of the unsigned VAA. diff --git a/bridge/pkg/processor/observation.go b/bridge/pkg/processor/observation.go index a1b12eae..8227882f 100644 --- a/bridge/pkg/processor/observation.go +++ b/bridge/pkg/processor/observation.go @@ -208,6 +208,10 @@ func (p *Processor) handleObservation(ctx context.Context, m *gossipv1.SignedObs GuardianSetIndex: v.GuardianSetIndex, Signatures: sigs, Timestamp: v.Timestamp, + Nonce: v.Nonce, + Sequence: v.Sequence, + EmitterChain: v.EmitterChain, + EmitterAddress: v.EmitterAddress, Payload: v.Payload, } diff --git a/bridge/pkg/solana/client.go b/bridge/pkg/solana/client.go index 9e6cfd2f..ba26e555 100644 --- a/bridge/pkg/solana/client.go +++ b/bridge/pkg/solana/client.go @@ -114,10 +114,16 @@ func (s *SolanaWatcher) Run(ctx context.Context) error { Filters: []rpc.RPCFilter{ { Memcmp: &rpc.RPCFilterMemcmp{ - Offset: 0, // Offset of VaaTime + Offset: 0, // Start of the account Bytes: solana.Base58{'m', 's', 'g'}, // Prefix of the posted message accounts }, }, + { + Memcmp: &rpc.RPCFilterMemcmp{ + Offset: 4, // Offset of VaaTime + Bytes: solana.Base58{0, 0, 0, 0}, // This means this VAA hasn't been signed yet + }, + }, }, }) queryLatency.WithLabelValues("get_program_accounts").Observe(time.Since(start).Seconds()) @@ -158,7 +164,7 @@ func (s *SolanaWatcher) Run(ctx context.Context) error { Timestamp: time.Unix(int64(proposal.SubmissionTime), 0), Nonce: proposal.Nonce, Sequence: proposal.Sequence, - EmitterChain: proposal.EmitterChain, + EmitterChain: vaa.ChainIDSolana, EmitterAddress: proposal.EmitterAddress, Payload: proposal.Payload, } @@ -188,7 +194,7 @@ type ( SubmissionTime uint32 Nonce uint32 Sequence uint64 - EmitterChain vaa.ChainID + EmitterChain uint16 EmitterAddress vaa.Address Payload []byte } @@ -196,7 +202,8 @@ type ( func ParseTransferOutProposal(data []byte) (*MessagePublicationAccount, error) { prop := &MessagePublicationAccount{} - if err := borsh.Deserialize(prop, data); err != nil { + // Skip the b"msg" prefix + if err := borsh.Deserialize(prop, data[3:]); err != nil { return nil, err } diff --git a/solana/bridge/program/src/types.rs b/solana/bridge/program/src/types.rs index d91b9e9b..878af36d 100644 --- a/solana/bridge/program/src/types.rs +++ b/solana/bridge/program/src/types.rs @@ -188,7 +188,7 @@ pub struct PostedMessageData { impl Owned for PostedMessage { fn owner(&self) -> AccountOwner { AccountOwner::Other( - Pubkey::from_str("96RHG3mfcckmrYN1UhmJzyS1XX3fZKbkeUcpJe9Sy3FE").unwrap(), + Pubkey::from_str("Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o").unwrap(), ) // TODO key of the bridge } }