Skip to content

Commit

Permalink
Bump chainlink-common to latest version (#390)
Browse files Browse the repository at this point in the history
* Bump common

* pkg/cosmos/txm: upgrade from deprecated funcs to SugaredLogger

---------

Co-authored-by: Jordan Krage <[email protected]>
  • Loading branch information
ferglor and jmank88 authored Dec 18, 2023
1 parent 33ce4c6 commit 6e0427c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.17.0
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231211141118-8632187920b3
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218150613-43bf581ae327
github.com/smartcontractkit/libocr v0.0.0-20230925165524-ffa38fe11ef8
github.com/stretchr/testify v1.8.4
github.com/tidwall/gjson v1.16.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231211141118-8632187920b3 h1:0/V7L1GLfk30j9VtOcZt2bCaDywfL8rHpo92tbQgg7U=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231211141118-8632187920b3/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218150613-43bf581ae327 h1:7P+djpKBMQ2Cpv1ieUQdkZvDLt6owPvniHfMHSPFYjQ=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218150613-43bf581ae327/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ require (
github.com/google/uuid v1.4.0
github.com/lib/pq v1.10.9
github.com/rs/zerolog v1.30.0
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231215165506-129e8c24b425
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231215171745-ddd8a09570e2
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218150613-43bf581ae327
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231215215216-51cb121f7f33
github.com/smartcontractkit/chainlink-cosmos/ops v0.0.0-20231206164210-03f8b219402e
github.com/smartcontractkit/chainlink-testing-framework v1.22.0
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20231215214204-43d28a8e46e7
github.com/smartcontractkit/chainlink/v2 v2.8.0-beta0.0.20231215214204-43d28a8e46e7
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20231215220731-a4091a3e4d3c
github.com/smartcontractkit/chainlink/v2 v2.8.0-beta0.0.20231215220731-a4091a3e4d3c
github.com/smartcontractkit/libocr v0.0.0-20231130143053-c5102a9c0fb7
github.com/stretchr/testify v1.8.4
gopkg.in/guregu/null.v4 v4.0.0
Expand Down
20 changes: 10 additions & 10 deletions integration-tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1155,24 +1155,24 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-automation v1.0.1 h1:vVjBFq2Zsz21kPy1Pb0wpjF9zrbJX+zjXphDeeR4XZk=
github.com/smartcontractkit/chainlink-automation v1.0.1/go.mod h1:INSchkV3ntyDdlZKGWA030MPDpp6pbeuiRkRKYFCm2k=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231215165506-129e8c24b425 h1:JojsduVLwfRl+KyfUlrLTQrnVs2WGLwZ1kDbSMHGRuE=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231215165506-129e8c24b425/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218150613-43bf581ae327 h1:7P+djpKBMQ2Cpv1ieUQdkZvDLt6owPvniHfMHSPFYjQ=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218150613-43bf581ae327/go.mod h1:IdlfCN9rUs8Q/hrOYe8McNBIwEOHEsi0jilb3Cw77xs=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ=
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d h1:w4MsbOtNk6nD/mcXLstHWk9hB6g7QLtcAfhPjhwvOaQ=
github.com/smartcontractkit/chainlink-feeds v0.0.0-20231127231053-2232d3a6766d/go.mod h1:YPAfLNowdBwiKiYOwgwtbJHi8AJWbcxkbOY0ItAvkfc=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231215171917-9ccfc80978a5 h1:f7UeKicl7xELR2xiSdahn+0D7AVYiyiLRmW6z3gJvF8=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231215171917-9ccfc80978a5/go.mod h1:UNzG9UcsrD1nMdI4dM7r+Ag+Yk+7U8OrYlKcZJD6muY=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231215171653-9b9cd71f12a5 h1:3jnSd5KMU1z9c8+kP6UDXc/ger6+VDCqpArRGUWbO4Q=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231215171653-9b9cd71f12a5/go.mod h1:7u19yu0ci3Z+8sEXqWoVe3/wqCne5+SjFKoZOdRLI3Y=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231215215420-f0b4a00004c1 h1:ARQvIJVbcYZy35GXbmcS1lz4Vc8eLozDiRPzZ1n2V7Q=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231215215420-f0b4a00004c1/go.mod h1:UNzG9UcsrD1nMdI4dM7r+Ag+Yk+7U8OrYlKcZJD6muY=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231215215547-68a402815b84 h1:c9fVySeSnjOU7s3LRDqVW967MKwoO2ISaSJmLLGDjEM=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231215215547-68a402815b84/go.mod h1:7u19yu0ci3Z+8sEXqWoVe3/wqCne5+SjFKoZOdRLI3Y=
github.com/smartcontractkit/chainlink-testing-framework v1.22.0 h1:Lur628wkrceWgcLmxGZe7Mauwxht4YO71hX9Jj5YslE=
github.com/smartcontractkit/chainlink-testing-framework v1.22.0/go.mod h1:yu6qqrppNJfutQV37fiSs4eS0uQP5QT0ebi3tlIgWN0=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 h1:FFdvEzlYwcuVHkdZ8YnZR/XomeMGbz5E2F2HZI3I3w8=
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868/go.mod h1:Kn1Hape05UzFZ7bOUnm3GVsHzP0TNrVmpfXYNHdqGGs=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20231215214204-43d28a8e46e7 h1:gtau/LP9gM1fQEz5XMnQeoScfeXNmrJjLBL0HEOECaI=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20231215214204-43d28a8e46e7/go.mod h1:HZ6dZsxY3zlIVIuhRrJhm2s+1OYRX/UuMOqqwR/yxTs=
github.com/smartcontractkit/chainlink/v2 v2.8.0-beta0.0.20231215214204-43d28a8e46e7 h1:XAcxxeVRH1Mp5NDk0Lv0/DSizSK1AKmlVghEJ/EsJwQ=
github.com/smartcontractkit/chainlink/v2 v2.8.0-beta0.0.20231215214204-43d28a8e46e7/go.mod h1:87bYiXfANVHAIq4uy14hlvL1haaB+RQuwHeIOVZsU4Y=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20231215220731-a4091a3e4d3c h1:k7qGZLRhQihZr+GmXXJXNaTJxh0KSDOGR3gPtiiPz5I=
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20231215220731-a4091a3e4d3c/go.mod h1:4N7BFfL8/AogYSwwLAW2KmKCPQbewZ6LcKqngFbVCEE=
github.com/smartcontractkit/chainlink/v2 v2.8.0-beta0.0.20231215220731-a4091a3e4d3c h1:XlDSTa5mopZeVsNGNzdHEZKfWm6IPhL6GfDpt+7xizg=
github.com/smartcontractkit/chainlink/v2 v2.8.0-beta0.0.20231215220731-a4091a3e4d3c/go.mod h1:+P6mpDYbhL8FVWlgYuQvjOtBd9XhazoFW1+1iljCn4M=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
19 changes: 9 additions & 10 deletions pkg/cosmos/txm/txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Txm struct {
services.StateMachine
newMsgs chan struct{}
orm *ORM
lggr logger.Logger
lggr logger.SugaredLogger
tc func() (client.ReaderWriter, error)
keystoreAdapter *keystoreAdapter
stop, done chan struct{}
Expand All @@ -50,12 +50,11 @@ type Txm struct {

// NewTxm creates a txm. Uses simulation so should only be used to send txes to trusted contracts i.e. OCR.
func NewTxm(db *sqlx.DB, tc func() (client.ReaderWriter, error), gpe client.ComposedGasPriceEstimator, chainID string, cfg config.Config, ks loop.Keystore, lggr logger.Logger) *Txm {
lggr = logger.Named(lggr, "Txm")
keystoreAdapter := newKeystoreAdapter(ks, cfg.Bech32Prefix())
return &Txm{
newMsgs: make(chan struct{}, 1), // buffered to hold one pending request while unblocking callers
orm: NewORM(chainID, db),
lggr: lggr,
lggr: logger.Sugared(lggr).Named("Txm"),
tc: tc,
keystoreAdapter: keystoreAdapter,
stop: make(chan struct{}),
Expand Down Expand Up @@ -84,15 +83,15 @@ func (txm *Txm) confirmAnyUnconfirmed(ctx context.Context) {
broadcasted, err := txm.orm.GetMsgsState(ctx, db.Broadcasted, txm.cfg.MaxMsgsPerBatch())
if err != nil {
// Should never happen but if so, theoretically can retry with a reboot
logger.Criticalw(txm.lggr, "unable to look for broadcasted but unconfirmed txes", "err", err)
txm.lggr.Criticalw("unable to look for broadcasted but unconfirmed txes", "err", err)
return
}
if len(broadcasted) == 0 {
return
}
tc, err := txm.tc()
if err != nil {
logger.Criticalw(txm.lggr, "unable to get client for handling broadcasted but unconfirmed txes", "count", len(broadcasted), "err", err)
txm.lggr.Criticalw("unable to get client for handling broadcasted but unconfirmed txes", "count", len(broadcasted), "err", err)
return
}
msgsByTxHash := make(map[string]adapters.Msgs)
Expand Down Expand Up @@ -235,14 +234,14 @@ func (txm *Txm) sendMsgBatch(ctx context.Context) {
msg, sender, err2 := unmarshalMsg(m.Type, m.Raw)
if err2 != nil {
// Should be impossible given the check in Enqueue
logger.Criticalw(txm.lggr, "Failed to unmarshal msg, skipping", "err", err2, "msg", m)
txm.lggr.Criticalw("Failed to unmarshal msg, skipping", "err", err2, "msg", m)
continue
}
m.DecodedMsg = msg
_, err2 = sdk.AccAddressFromBech32(sender)
if err2 != nil {
// Should never happen, we parse sender on Enqueue
logger.Criticalw(txm.lggr, "Unable to parse sender", "err", err2, "sender", sender)
txm.lggr.Criticalw("Unable to parse sender", "err", err2, "sender", sender)
continue
}
msgsByFrom[sender] = append(msgsByFrom[sender], m)
Expand All @@ -252,7 +251,7 @@ func (txm *Txm) sendMsgBatch(ctx context.Context) {
gasPrice, err := txm.GasPrice()
if err != nil {
// Should be impossible
logger.Criticalw(txm.lggr, "Failed to get gas price", "err", err)
txm.lggr.Criticalw("Failed to get gas price", "err", err)
return
}
for s, msgs := range msgsByFrom {
Expand All @@ -272,7 +271,7 @@ func (txm *Txm) sendMsgBatch(ctx context.Context) {
func (txm *Txm) sendMsgBatchFromAddress(ctx context.Context, gasPrice sdk.DecCoin, sender sdk.AccAddress, msgs adapters.Msgs) error {
tc, err := txm.tc()
if err != nil {
logger.Criticalw(txm.lggr, "unable to get client", "err", err)
txm.lggr.Criticalw("unable to get client", "err", err)
return err
}
an, sn, err := tc.Account(sender)
Expand Down Expand Up @@ -361,7 +360,7 @@ func (txm *Txm) sendMsgBatchFromAddress(ctx context.Context, gasPrice sdk.DecCoi
}
if resp.TxResponse.TxHash != txHash {
// Should never happen
logger.Criticalw(txm.lggr, "txhash mismatch", "got", resp.TxResponse.TxHash, "want", txHash)
txm.lggr.Criticalw("txhash mismatch", "got", resp.TxResponse.TxHash, "want", txHash)
}
return nil
})
Expand Down

0 comments on commit 6e0427c

Please sign in to comment.