diff --git a/chains/go.mod b/chains/go.mod index f99b3a3..e7dafcd 100644 --- a/chains/go.mod +++ b/chains/go.mod @@ -1,15 +1,13 @@ module github.com/smartcontractkit/chainlink-framework/chains -go 1.24.1 - -toolchain go1.24.2 +go 1.24.2 require ( github.com/google/uuid v1.6.0 github.com/jpillora/backoff v1.0.0 github.com/prometheus/client_golang v1.21.1 github.com/shopspring/decimal v1.4.0 - github.com/smartcontractkit/chainlink-common v0.7.1-0.20250509155341-2b5a5170a351 + github.com/smartcontractkit/chainlink-common v0.7.1-0.20250521163734-723cad356d85 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 github.com/stretchr/testify v1.10.0 go.uber.org/multierr v1.11.0 @@ -73,7 +71,7 @@ require ( golang.org/x/text v0.23.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect - google.golang.org/grpc v1.71.0 // indirect + google.golang.org/grpc v1.72.0 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/chains/go.sum b/chains/go.sum index 7ed6b96..96e458e 100644 --- a/chains/go.sum +++ b/chains/go.sum @@ -90,8 +90,8 @@ github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/smartcontractkit/chainlink-common v0.7.1-0.20250509155341-2b5a5170a351 h1:luR7oS01qzkw8anxnSYaXurzKzMdgl5ROKFm1/I6llY= -github.com/smartcontractkit/chainlink-common v0.7.1-0.20250509155341-2b5a5170a351/go.mod h1:uNF6+noody47ZdmRwymDZAnQ7eKTXLzMKvl41LA63lo= +github.com/smartcontractkit/chainlink-common v0.7.1-0.20250521163734-723cad356d85 h1:EMnHaq7rzuB4m8Ebd+/C/yBVBz088OSrV5JbZV+An04= +github.com/smartcontractkit/chainlink-common v0.7.1-0.20250521163734-723cad356d85/go.mod h1:TF9ZqBV0QA3X1T4BoLGp0FfJpOQOcQ+ggKu1MlsWKYw= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260 h1:See2isL6KdrTJDlVKWv8qiyYqWhYUcubU2e5yKXV1oY= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20250115203616-a2ea5e50b260/go.mod h1:4JqpgFy01LaqG1yM2iFTzwX3ZgcAvW9WdstBZQgPHzU= github.com/smartcontractkit/freeport v0.1.0 h1:3MZHeti5m+tSTBCq5R8rhawFHxrnQZYBZVL+xgS1sPo= @@ -175,8 +175,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a h1: google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 h1:e0AIkUUhxyBKh6ssZNrAMeqhA7RKUj42346d1y02i2g= google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= -google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= +google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= +google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/chains/txmgr/txmgr.go b/chains/txmgr/txmgr.go index e044fb7..249abce 100644 --- a/chains/txmgr/txmgr.go +++ b/chains/txmgr/txmgr.go @@ -743,17 +743,16 @@ func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) GetTransactionFee(ctx return fee, fmt.Errorf("failed to find receipt with IdempotencyKey %s", transactionID) } + totalFee := new(big.Int) + gasUsed := new(big.Int).SetUint64(receipt.GetFeeUsed()) price := receipt.GetEffectiveGasPrice() - totalFee := new(big.Int).Mul(gasUsed, price) - - status, err := b.GetTransactionStatus(ctx, transactionID) - if err != nil { - return fee, fmt.Errorf("failed to find transaction with IdempotencyKey %s: %w", transactionID, err) + if price != nil { + totalFee.Mul(gasUsed, price) } - - if status != commontypes.Finalized { - return fee, fmt.Errorf("tx status is not finalized") + l1Fee := receipt.GetL1Fee() + if l1Fee != nil { + totalFee.Add(totalFee, l1Fee) } fee = &evmtypes.TransactionFee{ diff --git a/chains/txmgr/types/tx_store.go b/chains/txmgr/types/tx_store.go index a875cc7..365c40a 100644 --- a/chains/txmgr/types/tx_store.go +++ b/chains/txmgr/types/tx_store.go @@ -116,4 +116,5 @@ type ChainReceipt[THASH, BHASH chains.Hashable] interface { GetBlockHash() BHASH GetRevertReason() *string GetEffectiveGasPrice() *big.Int + GetL1Fee() *big.Int }