Skip to content

Commit

Permalink
chore: updated the paloma version and removed the creator field in msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
vishal-kanna committed Mar 4, 2024
1 parent 50c7d31 commit fbfa857
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 202 deletions.
40 changes: 20 additions & 20 deletions chain/evm/compass.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,26 +479,26 @@ func (t compass) processMessages(ctx context.Context, queueTypeName string, msgs
logger.Debug("processing")

switch action := msg.GetAction().(type) {
case *evmtypes.Message_TransferERC20Ownership:
logger := logger.WithFields(log.Fields{
"chain-reference-id": t.ChainReferenceID,
"msg-id": rawMsg.ID,
"msg-bytes-to-sign": rawMsg.BytesToSign,
"msg-msg": rawMsg.Msg,
"msg-nonce": rawMsg.Nonce,
"msg-public-access-data": rawMsg.PublicAccessData,
"message-type": "Message_TransferERC20Ownership",
"new-compass-address": string(action.TransferERC20Ownership.NewCompassAddress),
"last-tx-hash-lkup": lastTxHashLkup,
})
logger.Info("Processing erc20 transfer ownership message")
if err := t.paloma.SetPublicAccessData(ctx, queueTypeName, rawMsg.ID, lastTxHashLkup[t.ChainReferenceID]); err != nil {
logger.WithError(err).Error("Failed to process erc20 transfer ownership message")
gErr.Add(err)
return gErr
}
logger.Info("Processed erc20 transfer ownership message")
return nil
// case *evmtypes.TransferERC20Ownership:
// logger := logger.WithFields(log.Fields{
// "chain-reference-id": t.ChainReferenceID,
// "msg-id": rawMsg.ID,
// "msg-bytes-to-sign": rawMsg.BytesToSign,
// "msg-msg": rawMsg.Msg,
// "msg-nonce": rawMsg.Nonce,
// "msg-public-access-data": rawMsg.PublicAccessData,
// "message-type": "Message_TransferERC20Ownership",
// "new-compass-address": string(action.TransferERC20Ownership.NewCompassAddress),
// "last-tx-hash-lkup": lastTxHashLkup,
// })
// logger.Info("Processing erc20 transfer ownership message")
// if err := t.paloma.SetPublicAccessData(ctx, queueTypeName, rawMsg.ID, lastTxHashLkup[t.ChainReferenceID]); err != nil {
// logger.WithError(err).Error("Failed to process erc20 transfer ownership message")
// gErr.Add(err)
// return gErr
// }
// logger.Info("Processed erc20 transfer ownership message")
// return nil
case *evmtypes.Message_SubmitLogicCall:
tx, processingErr = t.submitLogicCall(
ctx,
Expand Down
21 changes: 15 additions & 6 deletions chain/paloma/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ func (c *Client) AddExternalChainInfo(ctx context.Context, chainInfos ...ChainIn
}

msg := &valset.MsgAddExternalChainInfoForValidator{
Creator: c.creator,
Metadata: valset.MsgMetadata{
Creator: c.creator,
},
}

msg.ChainInfos = slice.Map(
Expand All @@ -150,10 +152,12 @@ func (c *Client) AddMessageEvidence(ctx context.Context, queueTypeName string, m
return err
}
msg := &consensus.MsgAddEvidence{
Creator: c.creator,
Proof: anyProof,
MessageID: messageID,
QueueTypeName: queueTypeName,
Metadata: valset.MsgMetadata{
Creator: c.creator,
},
}

_, err = c.MessageSender.SendMsg(ctx, msg, "", c.sendingOpts...)
Expand All @@ -162,7 +166,6 @@ func (c *Client) AddMessageEvidence(ctx context.Context, queueTypeName string, m

func (c *Client) SetPublicAccessData(ctx context.Context, queueTypeName string, messageID uint64, data []byte) error {
msg := &consensus.MsgSetPublicAccessData{
Creator: c.creator,
Data: data,
MessageID: messageID,
QueueTypeName: queueTypeName,
Expand All @@ -174,10 +177,12 @@ func (c *Client) SetPublicAccessData(ctx context.Context, queueTypeName string,

func (c *Client) SetErrorData(ctx context.Context, queueTypeName string, messageID uint64, data []byte) error {
msg := &consensus.MsgSetErrorData{
Creator: c.creator,
Data: data,
MessageID: messageID,
QueueTypeName: queueTypeName,
Metadata: valset.MsgMetadata{
Creator: c.creator,
},
}

_, err := c.MessageSender.SendMsg(ctx, msg, "", c.sendingOpts...)
Expand All @@ -186,8 +191,10 @@ func (c *Client) SetErrorData(ctx context.Context, queueTypeName string, message

func (c *Client) KeepValidatorAlive(ctx context.Context, appVersion string) error {
msg := &valset.MsgKeepAlive{
Creator: c.creator,
PigeonVersion: appVersion,
Metadata: valset.MsgMetadata{
Creator: c.creator,
},
}

_, err := c.MessageSender.SendMsg(ctx, msg, "", c.sendingOpts...)
Expand Down Expand Up @@ -254,8 +261,10 @@ func broadcastMessageSignatures(
}
}
msg := &consensus.MsgAddMessagesSignatures{
Creator: creator,
SignedMessages: signedMessages,
Metadata: valset.MsgMetadata{
Creator: creator,
},
}
_, err := ms.SendMsg(ctx, msg, "", opts...)
return err
Expand Down
9 changes: 7 additions & 2 deletions chain/paloma/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
consensus "github.com/palomachain/paloma/x/consensus/types"
consensusmocks "github.com/palomachain/paloma/x/consensus/types/mocks"
valset "github.com/palomachain/paloma/x/valset/types"
valsettypes "github.com/palomachain/paloma/x/valset/types"
valsetmocks "github.com/palomachain/paloma/x/valset/types/mocks"
"github.com/palomachain/pigeon/chain"
clientmocks "github.com/palomachain/pigeon/chain/paloma/mocks"
Expand Down Expand Up @@ -339,7 +340,9 @@ func TestKeepValidatorAlive(t *testing.T) {
msgSender := clientmocks.NewMessageSender(t)
msgSender.On("SendMsg",
mock.Anything, &valset.MsgKeepAlive{
Creator: creator,
Metadata: valsettypes.MsgMetadata{
Creator: creator,
},
PigeonVersion: "v1.3.0",
},
"",
Expand Down Expand Up @@ -407,7 +410,9 @@ func TestBroadcastingMessageSignatures(t *testing.T) {
setup: func() MessageSender {
msgSender := clientmocks.NewMessageSender(t)
expectedSignaturesMsg := &consensus.MsgAddMessagesSignatures{
Creator: creator,
Metadata: valsettypes.MsgMetadata{
Creator: creator,
},
SignedMessages: []*consensus.ConsensusMessageSignature{
{
Id: 123,
Expand Down
17 changes: 11 additions & 6 deletions chain/paloma/wrappers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
palomatypes "github.com/palomachain/paloma/x/paloma/types"
valsettypes "github.com/palomachain/paloma/x/valset/types"
"github.com/palomachain/pigeon/chain/paloma"
"github.com/palomachain/pigeon/util/ion"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -87,9 +88,11 @@ func Test_PalomaMessageSender_SendMsg(t *testing.T) {
WithSignerProvider(func() string { return signer })

msg := &palomatypes.MsgAddStatusUpdate{
Creator: "foo",
Status: "bar",
Level: palomatypes.MsgAddStatusUpdate_LEVEL_INFO,
Status: "bar",
Level: palomatypes.MsgAddStatusUpdate_LEVEL_INFO,
Metadata: valsettypes.MsgMetadata{
Creator: "foo",
},
}

sender.expectedMsg = msg
Expand All @@ -110,9 +113,11 @@ func Test_PalomaMessageSender_SendMsg(t *testing.T) {
wg := &sync.WaitGroup{}

msg := &palomatypes.MsgAddStatusUpdate{
Creator: "foo",
Status: "bar",
Level: palomatypes.MsgAddStatusUpdate_LEVEL_INFO,
Status: "bar",
Level: palomatypes.MsgAddStatusUpdate_LEVEL_INFO,
Metadata: valsettypes.MsgMetadata{
Creator: "foo",
},
}
sender.expectedMsg = msg

Expand Down
98 changes: 49 additions & 49 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,51 @@ module github.com/palomachain/pigeon
go 1.21

require (
cosmossdk.io/errors v1.0.0
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.2.0
cosmossdk.io/store v1.0.1
cosmossdk.io/store v1.0.2
cosmossdk.io/x/feegrant v0.1.0
cosmossdk.io/x/upgrade v0.1.1
github.com/VolumeFi/whoops v0.7.2
github.com/avast/retry-go/v4 v4.3.3
github.com/cometbft/cometbft v0.38.2
github.com/cosmos/cosmos-sdk v0.50.2
github.com/cometbft/cometbft v0.38.5
github.com/cosmos/cosmos-sdk v0.50.4
github.com/cosmos/gogoproto v1.4.11
github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/cosmos/ibc-go/v8 v8.0.0
github.com/ethereum/go-ethereum v1.13.7
github.com/ethereum/go-ethereum v1.13.13
github.com/go-resty/resty/v2 v2.10.0
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/jarcoal/httpmock v1.3.1
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.29.0
github.com/palomachain/paloma v1.3.1-next.0.20240118053357-bcdf4d248c51
github.com/palomachain/paloma v1.3.1-next.0.20240227162349-a4b1e22d4363
github.com/roodeag/arbitrum v0.0.0-20230627104516-b95e4c8ebec0
github.com/rs/xid v1.5.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.8.4
golang.org/x/exp v0.0.0-20231127185646-65229373498e
golang.org/x/term v0.15.0
google.golang.org/grpc v1.60.0
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a
golang.org/x/term v0.17.0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.32.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cloud.google.com/go v0.110.9 // indirect
cloud.google.com/go/compute v1.23.2 // indirect
cloud.google.com/go v0.110.10 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.4 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/api v0.7.2 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/storage v1.35.1 // indirect
cosmossdk.io/api v0.7.3 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/log v1.2.1 // indirect
cosmossdk.io/x/tx v0.12.0 // indirect
cosmossdk.io/log v1.3.1 // indirect
cosmossdk.io/x/tx v0.13.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
Expand All @@ -66,18 +67,18 @@ require (
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cometbft/cometbft-db v0.9.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-db v1.0.0 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/iavl v1.0.0 // indirect
github.com/cosmos/iavl v1.0.1 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
Expand All @@ -90,19 +91,19 @@ require (
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/emicklei/dot v1.6.0 // indirect
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
github.com/emicklei/dot v1.6.1 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gammazero/deque v0.2.1 // indirect
github.com/getsentry/sentry-go v0.25.0 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
Expand All @@ -118,8 +119,8 @@ require (
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -144,17 +145,16 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/klauspost/compress v1.17.6 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.8.6 // indirect
github.com/linxGnu/grocksdb v1.8.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
Expand All @@ -167,23 +167,23 @@ require (
github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.31.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.17.0 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/supranational/blst v0.3.11 // indirect
Expand All @@ -198,21 +198,21 @@ require (
go.etcd.io/bbolt v1.3.8 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.143.0 // indirect
google.golang.org/api v0.153.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gotest.tools/v3 v3.5.1 // indirect
Expand Down
Loading

0 comments on commit fbfa857

Please sign in to comment.