From 2a0c8ff38fccdad5ec79cccda6e6625986dce963 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:53:35 +0300 Subject: [PATCH 1/6] chore: reduced empty blocks and batch submission default values (#391) --- config/defaults.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/defaults.go b/config/defaults.go index 3ccc45bc4..d29d2b8d0 100644 --- a/config/defaults.go +++ b/config/defaults.go @@ -29,8 +29,8 @@ func DefaultConfig(home, chainId string) *NodeConfig { Aggregator: true, BlockManagerConfig: BlockManagerConfig{ BlockTime: 200 * time.Millisecond, - EmptyBlocksMaxTime: 60 * time.Second, - BatchSubmitMaxTime: 600 * time.Second, + EmptyBlocksMaxTime: 3 * time.Second, + BatchSubmitMaxTime: 30 * time.Second, NamespaceID: "000000000000ffff", BlockBatchSize: 500, BlockBatchMaxSizeBytes: 1500000}, From 7244e688682f8e62b3107bff9a9ddf377645b0a1 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Mon, 10 Jul 2023 15:53:47 +0300 Subject: [PATCH 2/6] fix: initializing LastValidatorSet as well on InitChain (#390) --- block/manager.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/block/manager.go b/block/manager.go index baec63d82..0d3eba315 100644 --- a/block/manager.go +++ b/block/manager.go @@ -133,7 +133,6 @@ func NewManager( return nil, err } validators = append(validators, tmtypes.NewValidator(tmPubKey, 1)) - } res, err := exec.InitChain(genesis, validators) @@ -817,6 +816,11 @@ func updateInitChainState(s *types.State, res *abci.ResponseInitChain, validator copy(s.AppHash[:], res.AppHash) } + //The validators after initChain must be greater than zero, otherwise this state is not loadable + if len(validators) <= 0 { + panic("Validators must be greater than zero") + } + if res.ConsensusParams != nil { params := res.ConsensusParams if params.Block != nil { @@ -841,8 +845,8 @@ func updateInitChainState(s *types.State, res *abci.ResponseInitChain, validator // We update the last results hash with the empty hash, to conform with RFC-6962. copy(s.LastResultsHash[:], merkle.HashFromByteSlices(nil)) - if len(validators) > 0 { - s.Validators = tmtypes.NewValidatorSet(validators) - s.NextValidators = tmtypes.NewValidatorSet(validators).CopyIncrementProposerPriority(1) - } + // Set the validators in the state + s.Validators = tmtypes.NewValidatorSet(validators).CopyIncrementProposerPriority(1) + s.NextValidators = s.Validators.Copy() + s.LastValidators = s.Validators.Copy() } From eacd50c7480995bbc5032abb123aee13f653f6e3 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Sun, 30 Jul 2023 12:50:47 +0300 Subject: [PATCH 3/6] feat: gas adjustmnet parsable for celestia config (#425) --- da/celestia/celestia.go | 6 +++++- da/celestia/config.go | 14 ++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/da/celestia/celestia.go b/da/celestia/celestia.go index ec011a0cf..f5276788a 100644 --- a/da/celestia/celestia.go +++ b/da/celestia/celestia.go @@ -103,6 +103,10 @@ func (c *DataAvailabilityLayerClient) Init(config []byte, pubsubServer *pubsub.S return errors.New("fee or gas prices must be set") } + if c.config.GasAdjustment == 0 { + c.config.GasAdjustment = defaultGasAdjustment + } + c.pubsubServer = pubsubServer // Set defaults c.txPollingRetryDelay = defaultTxPollingRetryDelay @@ -168,7 +172,7 @@ func (c *DataAvailabilityLayerClient) SubmitBatch(batch *types.Batch) da.ResultS return da.ResultSubmitBatch{} default: estimatedGas := EstimateGas(len(blob)) - gasWanted := uint64(float64(estimatedGas) * gasAdjustment) + gasWanted := uint64(float64(estimatedGas) * c.config.GasAdjustment) fees := c.calculateFees(gasWanted) //SubmitPFB sets an error if the txResponse has error, so we check check the txResponse for error diff --git a/da/celestia/config.go b/da/celestia/config.go index 2e7180e79..936922510 100644 --- a/da/celestia/config.go +++ b/da/celestia/config.go @@ -8,12 +8,12 @@ import ( ) const ( - defaultTxPollingRetryDelay = 20 * time.Second - defaultSubmitRetryDelay = 10 * time.Second - defaultTxPollingAttempts = 5 - namespaceVersion = 0 - defaultGasPrices = 0.1 - gasAdjustment = 1.3 + defaultTxPollingRetryDelay = 20 * time.Second + defaultSubmitRetryDelay = 10 * time.Second + defaultTxPollingAttempts = 5 + namespaceVersion = 0 + defaultGasPrices = 0.1 + defaultGasAdjustment float64 = 1.3 ) // Config stores Celestia DALC configuration parameters. @@ -23,6 +23,7 @@ type Config struct { Timeout time.Duration `json:"timeout"` Fee int64 `json:"fee"` GasPrices float64 `json:"gas_prices"` + GasAdjustment float64 `json:"gas_adjustment"` GasLimit uint64 `json:"gas_limit"` NamespaceIDStr string `json:"namespace_id"` NamespaceID cnc.Namespace `json:"-"` @@ -35,6 +36,7 @@ var CelestiaDefaultConfig = Config{ Fee: 0, GasLimit: 20000000, GasPrices: defaultGasPrices, + GasAdjustment: defaultGasAdjustment, NamespaceIDStr: "000000000000ffff", NamespaceID: cnc.Namespace{Version: namespaceVersion, ID: []byte{0, 0, 0, 0, 0, 0, 255, 255}}, } From 6a045ea0ba483c8a87b07d142c26f69611a89d8d Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Sun, 30 Jul 2023 13:40:03 +0300 Subject: [PATCH 4/6] feat: update celestia fee calculation function (#427) --- da/celestia/celestia.go | 2 +- da/celestia/fees.go | 62 ++++++++++++++++++++++--- da/celestia/fees_test.go | 62 +++++++++++++++++++++++++ da/celestia/types/types.go | 93 ++++++++++++++++++++++++++++++++++++++ go.mod | 27 +++++++---- go.sum | 66 ++++++++++++++++----------- 6 files changed, 267 insertions(+), 45 deletions(-) create mode 100644 da/celestia/fees_test.go create mode 100644 da/celestia/types/types.go diff --git a/da/celestia/celestia.go b/da/celestia/celestia.go index f5276788a..ff995b488 100644 --- a/da/celestia/celestia.go +++ b/da/celestia/celestia.go @@ -171,7 +171,7 @@ func (c *DataAvailabilityLayerClient) SubmitBatch(batch *types.Batch) da.ResultS c.logger.Debug("Context cancelled") return da.ResultSubmitBatch{} default: - estimatedGas := EstimateGas(len(blob)) + estimatedGas := DefaultEstimateGas(uint32(len(blob))) gasWanted := uint64(float64(estimatedGas) * c.config.GasAdjustment) fees := c.calculateFees(gasWanted) diff --git a/da/celestia/fees.go b/da/celestia/fees.go index 8af0c9f09..8240b5f00 100644 --- a/da/celestia/fees.go +++ b/da/celestia/fees.go @@ -1,9 +1,37 @@ package celestia +import ( + "github.com/dymensionxyz/dymint/da/celestia/types" +) + const ( - perByteGasTolerance = 2 - pfbGasFixedCost = 80000 - defaultGasPerBlobByte = 8 + ShareSize = types.ShareSize + + // PFBGasFixedCost is a rough estimate for the "fixed cost" in the gas cost + // formula: gas cost = gas per byte * bytes per share * shares occupied by + // blob + "fixed cost". In this context, "fixed cost" accounts for the gas + // consumed by operations outside the blob's GasToConsume function (i.e. + // signature verification, tx size, read access to accounts). + // + // Since the gas cost of these operations is not easy to calculate, linear + // regression was performed on a set of observed data points to derive an + // approximate formula for gas cost. Assuming gas per byte = 8 and bytes per + // share = 512, we can solve for "fixed cost" and arrive at 65,000. gas cost + // = 8 * 512 * number of shares occupied by the blob + 65,000 has a + // correlation coefficient of 0.996. To be conservative, we round up "fixed + // cost" to 75,000 because the first tx always takes up 10,000 more gas than + // subsequent txs. + PFBGasFixedCost = 75000 + + // BytesPerBlobInfo is a rough estimation for the amount of extra bytes in + // information a blob adds to the size of the underlying transaction. + BytesPerBlobInfo = 70 + + // DefaultGasPerBlobByte is the default gas cost deducted per byte of blob + // included in a PayForBlobs txn + DefaultGasPerBlobByte = 8 + + DefaultTxSizeCostPerByte uint64 = 10 ) func (c *DataAvailabilityLayerClient) calculateFees(gas uint64) int64 { @@ -15,8 +43,28 @@ func (c *DataAvailabilityLayerClient) calculateFees(gas uint64) int64 { return fees } -// EstimateGas estimates the gas required to pay for a set of blobs in a PFB. -func EstimateGas(blobSizes int) uint64 { - variableGasAmount := (defaultGasPerBlobByte + perByteGasTolerance) * blobSizes - return uint64(variableGasAmount + pfbGasFixedCost) +// GasToConsume works out the extra gas charged to pay for a set of blobs in a PFB. +// Note that tranasctions will incur other gas costs, such as the signature verification +// and reads to the user's account. +func GasToConsume(blobSizes []uint32, gasPerByte uint32) uint64 { + var totalSharesUsed uint64 + for _, size := range blobSizes { + totalSharesUsed += uint64(types.SparseSharesNeeded(size)) + } + + return totalSharesUsed * types.ShareSize * uint64(gasPerByte) +} + +// EstimateGas estimates the total gas required to pay for a set of blobs in a PFB. +// It is based on a linear model that is dependent on the governance parameters: +// gasPerByte and txSizeCost. It assumes other variables are constant. This includes +// assuming the PFB is the only message in the transaction. +func EstimateGas(blobSizes []uint32, gasPerByte uint32, txSizeCost uint64) uint64 { + return GasToConsume(blobSizes, gasPerByte) + (txSizeCost * BytesPerBlobInfo * uint64(len(blobSizes))) + PFBGasFixedCost +} + +// DefaultEstimateGas runs EstimateGas with the system defaults. The network may change these values +// through governance, thus this function should predominantly be used in testing. +func DefaultEstimateGas(blobSize uint32) uint64 { + return EstimateGas([]uint32{blobSize}, DefaultGasPerBlobByte, DefaultTxSizeCostPerByte) } diff --git a/da/celestia/fees_test.go b/da/celestia/fees_test.go new file mode 100644 index 000000000..1359bac81 --- /dev/null +++ b/da/celestia/fees_test.go @@ -0,0 +1,62 @@ +package celestia + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +const ( + gasAdjust = 2 +) + +func Test(t *testing.T) { + testCases := []struct { + desc string + blobSize uint32 + measuredGas uint64 + gasAdjust float64 + }{ + { + desc: "", + blobSize: 3576, + measuredGas: 106230, + }, + { + desc: "", + blobSize: 6282, + measuredGas: 120850, + }, + { + desc: "", + blobSize: 12074, + measuredGas: 170002, + gasAdjust: gasAdjust, + }, + { + desc: "", + blobSize: 16908, + measuredGas: 323804, + gasAdjust: gasAdjust, + }, + { + desc: "", + blobSize: 31343, + measuredGas: 333852, + }, + { + desc: "", + blobSize: 43248, + measuredGas: 432156, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + expectedGas := DefaultEstimateGas(tC.blobSize) + if tC.gasAdjust != 0 { + expectedGas = uint64(float64(expectedGas) * tC.gasAdjust) + } + assert.GreaterOrEqual(t, expectedGas, tC.measuredGas, "calculated gas is less than actually measured") + }) + } +} diff --git a/da/celestia/types/types.go b/da/celestia/types/types.go new file mode 100644 index 000000000..b4960aca2 --- /dev/null +++ b/da/celestia/types/types.go @@ -0,0 +1,93 @@ +package types + +//TODO: copied from + +import ( + "math" +) + +// These constants were originally sourced from: +// https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/consensus.md#constants +// +// They can not change throughout the lifetime of a network. +const ( + // NamespaceVersionSize is the size of a namespace version in bytes. + NamespaceVersionSize = 1 + // NamespaceVersionMaxValue is the maximum value a namespace version can be. + // This const must be updated if NamespaceVersionSize is changed. + NamespaceVersionMaxValue = math.MaxUint8 + + // NamespaceIDSize is the size of a namespace ID in bytes. + NamespaceIDSize = 28 + + // NamespaceSize is the size of a namespace (version + ID) in bytes. + NamespaceSize = NamespaceVersionSize + NamespaceIDSize + + // ShareSize is the size of a share in bytes. + ShareSize = 512 + + // ShareInfoBytes is the number of bytes reserved for information. The info + // byte contains the share version and a sequence start idicator. + ShareInfoBytes = 1 + + // SequenceLenBytes is the number of bytes reserved for the sequence length + // that is present in the first share of a sequence. + SequenceLenBytes = 4 + + // ShareVersionZero is the first share version format. + ShareVersionZero = uint8(0) + + // DefaultShareVersion is the defacto share version. Use this if you are + // unsure of which version to use. + DefaultShareVersion = ShareVersionZero + + // CompactShareReservedBytes is the number of bytes reserved for the location of + // the first unit (transaction, ISR) in a compact share. + CompactShareReservedBytes = 4 + + // FirstCompactShareContentSize is the number of bytes usable for data in + // the first compact share of a sequence. + FirstCompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - SequenceLenBytes - CompactShareReservedBytes + + // ContinuationCompactShareContentSize is the number of bytes usable for + // data in a continuation compact share of a sequence. + ContinuationCompactShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - CompactShareReservedBytes + + // FirstSparseShareContentSize is the number of bytes usable for data in the + // first sparse share of a sequence. + FirstSparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes - SequenceLenBytes + + // ContinuationSparseShareContentSize is the number of bytes usable for data + // in a continuation sparse share of a sequence. + ContinuationSparseShareContentSize = ShareSize - NamespaceSize - ShareInfoBytes + + // MinSquareSize is the smallest original square width. + MinSquareSize = 1 + + // MinshareCount is the minimum number of shares allowed in the original + // data square. + MinShareCount = MinSquareSize * MinSquareSize + + // MaxShareVersion is the maximum value a share version can be. + MaxShareVersion = 127 +) + +// SparseSharesNeeded returns the number of shares needed to store a sequence of +// length sequenceLen. +func SparseSharesNeeded(sequenceLen uint32) (sharesNeeded int) { + if sequenceLen == 0 { + return 0 + } + + if sequenceLen < FirstSparseShareContentSize { + return 1 + } + + bytesAvailable := FirstSparseShareContentSize + sharesNeeded++ + for uint32(bytesAvailable) < sequenceLen { + bytesAvailable += ContinuationSparseShareContentSize + sharesNeeded++ + } + return sharesNeeded +} diff --git a/go.mod b/go.mod index 0821ebd51..b58e9ef51 100644 --- a/go.mod +++ b/go.mod @@ -29,18 +29,19 @@ require ( github.com/rs/cors v1.8.3 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.14.0 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.34.28 go.uber.org/multierr v1.8.0 golang.org/x/net v0.9.0 gonum.org/v1/gonum v0.12.0 - google.golang.org/grpc v1.54.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/grpc v1.57.0 + google.golang.org/protobuf v1.31.0 ) require ( cosmossdk.io/math v1.0.0-rc.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/blang/semver v3.5.1+incompatible // indirect @@ -53,14 +54,16 @@ require ( github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect - github.com/ethereum/go-ethereum v1.10.26 // indirect + github.com/ethereum/go-ethereum v1.12.0 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-playground/validator/v10 v10.4.1 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/golang/mock v1.6.0 // indirect github.com/google/pprof v0.0.0-20221203041831-ce31453925ec // indirect github.com/hashicorp/go-uuid v1.0.1 // indirect github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect + github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-yamux/v4 v4.0.0 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -72,7 +75,8 @@ require ( github.com/quic-go/quic-go v0.33.0 // indirect github.com/quic-go/webtransport-go v0.5.1 // indirect github.com/satori/go.uuid v1.2.0 // indirect - github.com/sirupsen/logrus v1.9.0 // indirect + github.com/shirou/gopsutil v3.21.6+incompatible // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tidwall/btree v1.5.0 // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect @@ -81,6 +85,9 @@ require ( go.uber.org/dig v1.15.0 // indirect go.uber.org/fx v1.18.2 // indirect golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 // indirect + google.golang.org/api v0.114.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect nhooyr.io/websocket v1.8.7 // indirect sigs.k8s.io/yaml v1.3.0 // indirect @@ -124,7 +131,7 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect github.com/google/flatbuffers v1.12.1 // indirect github.com/google/gopacket v1.1.19 // indirect @@ -216,12 +223,12 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.7.0 // indirect - golang.org/x/mod v0.8.0 // indirect + golang.org/x/mod v0.9.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.7.0 // indirect golang.org/x/term v0.7.0 // indirect golang.org/x/text v0.9.0 // indirect - google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -232,13 +239,13 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cosmos/cosmos-sdk v0.46.13 github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/golang/glog v1.0.0 // indirect + github.com/golang/glog v1.1.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect github.com/ignite/cli v0.25.2 github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/smartystreets/assertions v1.0.1 // indirect - golang.org/x/tools v0.6.0 // indirect + golang.org/x/tools v0.7.0 // indirect ) replace ( diff --git a/go.sum b/go.sum index 7620c7b62..5324cbafb 100644 --- a/go.sum +++ b/go.sum @@ -26,11 +26,11 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY= +cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.12.0 h1:DRtTY29b75ciH6Ov1PHb4/iat2CLCvrOm40Q0a6DFpE= +cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -66,7 +66,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -182,6 +183,7 @@ github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/decred/base58 v1.0.4 h1:QJC6B0E0rXOPA8U/kw2rP+qiRJsUaE2Er+pYb3siUeA= github.com/decred/base58 v1.0.4/go.mod h1:jJswKPEdvpFpvf7dsDvFZyLT22xZ9lWqEByX38oGd9E= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= @@ -225,8 +227,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.10.26 h1:i/7d9RBBwiXCEuyduBQzJw/mKmnvzsN14jqBmytw72s= -github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= +github.com/ethereum/go-ethereum v1.12.0 h1:bdnhLPtqETd4m3mS8BGMNvBTf36bO5bx/hxE2zljOa0= +github.com/ethereum/go-ethereum v1.12.0/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= @@ -274,8 +276,9 @@ github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8c github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -299,8 +302,8 @@ github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE= +github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -336,8 +339,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -393,7 +397,7 @@ github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6cvPr8A= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f h1:KMlcu9X58lhTA/KrfX8Bi1LQSO4pzoVjTiL3h4Jk+Zk= @@ -444,6 +448,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= +github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= @@ -755,7 +761,8 @@ github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZj github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shirou/gopsutil v3.21.6+incompatible h1:mmZtAlWSd8U2HeRTjswbnDLPxqsEoK01NK+GZ1P+nEM= +github.com/shirou/gopsutil v3.21.6+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= @@ -782,8 +789,8 @@ github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5k github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= @@ -827,8 +834,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= @@ -966,8 +973,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1028,7 +1035,7 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1195,8 +1202,8 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1227,7 +1234,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU= +google.golang.org/api v0.114.0 h1:1xQPji6cO2E2vLiI+C/XiFAnsn1WV3mjaEwGLhi3grE= +google.golang.org/api v0.114.0/go.mod h1:ifYI2ZsFK6/uGddGfAD5BMxlnkBqCmqHSDUVi45N5Yg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1281,8 +1289,12 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54 h1:9NWlQfY2ePejTmfwUH1OWwmznFa+0kKcHGPDvcPza9M= +google.golang.org/genproto v0.0.0-20230526161137-0005af68ea54/go.mod h1:zqTuNwFlFRsw5zIts5VnzLQxSRqh+CGOTVMlYbY0Eyk= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 h1:m8v1xLLLzMe1m5P+gCTF8nJB9epwZQUBERm20Oy1poQ= +google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 h1:0nDDozoAU19Qb2HwhXadU8OcsiO/09cnTqhUtq2MEOM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= @@ -1303,8 +1315,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= +google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1317,8 +1329,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 9e359f61516ebe1d30f0bc53ac5f6d4c187094f2 Mon Sep 17 00:00:00 2001 From: Omri Date: Mon, 31 Jul 2023 12:35:16 +0200 Subject: [PATCH 5/6] fix: fixed bug where the unhealthy da event didn't stop block production (#431) --- da/celestia/celestia_test.go | 2 +- da/utils.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/da/celestia/celestia_test.go b/da/celestia/celestia_test.go index 790564b1c..293602901 100644 --- a/da/celestia/celestia_test.go +++ b/da/celestia/celestia_test.go @@ -132,7 +132,7 @@ func TestSubmitBatch(t *testing.T) { go func() { select { case event := <-HealthSubscription.Out(): - healthStatusEvent := event.Data().(da.EventDataDAHealthStatus) + healthStatusEvent := event.Data().(*da.EventDataDAHealthStatus) assert.Equal(tc.expectedHealthEvent.Healthy, healthStatusEvent.Healthy) done <- true break diff --git a/da/utils.go b/da/utils.go index 84040bfe1..034d55553 100644 --- a/da/utils.go +++ b/da/utils.go @@ -7,7 +7,7 @@ import ( ) func SubmitBatchHealthEventHelper(pubsubServer *pubsub.Server, ctx context.Context, healthy bool, err error) (ResultSubmitBatch, error) { - err = pubsubServer.PublishWithEvents(ctx, EventDataDAHealthStatus{Healthy: healthy, Error: err}, + err = pubsubServer.PublishWithEvents(ctx, &EventDataDAHealthStatus{Healthy: healthy, Error: err}, map[string][]string{EventTypeKey: {EventDAHealthStatus}}) if err != nil { return ResultSubmitBatch{ From 8bc479563c69a45f5c75a604df3e08dd87b44a1e Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Mon, 31 Jul 2023 14:04:21 +0300 Subject: [PATCH 6/6] fix: fix gas adjustment parameter (#432) --- config/toml.go | 2 +- da/celestia/celestia.go | 12 ++++++------ da/celestia/fees.go | 4 +++- da/celestia/fees_test.go | 16 ++++++++++++++++ settlement/dymension/dymension.go | 2 +- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/config/toml.go b/config/toml.go index 632f6fcc5..a0a2c997f 100644 --- a/config/toml.go +++ b/config/toml.go @@ -85,7 +85,7 @@ da_config = "{{ .DAConfig }}" block_batch_max_size_bytes = {{ .BlockManagerConfig.BlockBatchMaxSizeBytes }} #celestia config example: -# da_config = "{\"base_url\": \"http://127.0.0.1:26659\", \"timeout\": 60000000000, \"gas_prices\":0.1, \"gas_limit\": 20000000, \"namespace_id\":\"000000000000ffff\"}" +# da_config = "{\"base_url\": \"http://127.0.0.1:26659\", \"timeout\": 60000000000, \"gas_prices\":0.1, \"gas_adjustment\": 1.3, \"namespace_id\":\"000000000000ffff\"}" # Avail config example: # da_config = "{\"seed\": \"MNEMONIC\", \"api_url\": \"wss://kate.avail.tools/ws\", \"app_id\": 0, \"tip\":10}" diff --git a/da/celestia/celestia.go b/da/celestia/celestia.go index ff995b488..d7ea02565 100644 --- a/da/celestia/celestia.go +++ b/da/celestia/celestia.go @@ -164,19 +164,19 @@ func (c *DataAvailabilityLayerClient) SubmitBatch(batch *types.Batch) da.ResultS }, } } - c.logger.Debug("Submitting to da blob with size", "size", len(blob)) + estimatedGas := DefaultEstimateGas(uint32(len(blob))) + gasWanted := uint64(float64(estimatedGas) * c.config.GasAdjustment) + fees := c.calculateFees(gasWanted) + c.logger.Debug("Submitting to da blob with size", "size", len(blob), "estimatedGas", estimatedGas, "gasAdjusted", gasWanted, "fees", fees) + for { select { case <-c.ctx.Done(): c.logger.Debug("Context cancelled") return da.ResultSubmitBatch{} default: - estimatedGas := DefaultEstimateGas(uint32(len(blob))) - gasWanted := uint64(float64(estimatedGas) * c.config.GasAdjustment) - fees := c.calculateFees(gasWanted) - //SubmitPFB sets an error if the txResponse has error, so we check check the txResponse for error - txResponse, err := c.client.SubmitPFB(c.ctx, c.config.NamespaceID, blob, int64(fees), gasWanted) + txResponse, err := c.client.SubmitPFB(c.ctx, c.config.NamespaceID, blob, fees, gasWanted) if txResponse == nil { c.logger.Error("Failed to submit DA batch. Emitting health event and trying again", "error", err) res, err := da.SubmitBatchHealthEventHelper(c.pubsubServer, c.ctx, false, err) diff --git a/da/celestia/fees.go b/da/celestia/fees.go index 8240b5f00..0418db0c9 100644 --- a/da/celestia/fees.go +++ b/da/celestia/fees.go @@ -1,6 +1,8 @@ package celestia import ( + "math" + "github.com/dymensionxyz/dymint/da/celestia/types" ) @@ -37,7 +39,7 @@ const ( func (c *DataAvailabilityLayerClient) calculateFees(gas uint64) int64 { fees := c.config.Fee if fees == 0 { - fees = int64(c.config.GasPrices * float64(gas)) + fees = int64(math.Ceil(c.config.GasPrices * float64(gas))) } return fees diff --git a/da/celestia/fees_test.go b/da/celestia/fees_test.go index 1359bac81..19356e00d 100644 --- a/da/celestia/fees_test.go +++ b/da/celestia/fees_test.go @@ -49,6 +49,22 @@ func Test(t *testing.T) { blobSize: 43248, measuredGas: 432156, }, + { + // time="2023-07-30T18:23:38Z" level=debug msg="Submitting to da blob with size[size 506524]" module=celestia + // time="2023-07-30T18:23:38Z" level=error msg="Failed to submit DA batch. Emitting health event and trying again[txResponse insufficient fees; got: 100000utia required: 668882utia: insufficient fee code 13]" module=celestia + desc: "logged while using fixed price", + blobSize: 506524, + measuredGas: 6688820, + gasAdjust: gasAdjust, + }, + { + // time="2023-07-31T09:09:38Z" level=debug msg="Submitting to da blob with size[size 1499572]" module=celestia + // time="2023-07-31T09:09:40Z" level=error msg="Failed to submit DA batch. Emitting health event and trying again[txResponse insufficient fees; got: 1000000utia required: 1959844utia: insufficient fee code 13]" module=celestia + desc: "logged while using fixed price", + blobSize: 1499572, + measuredGas: 19598440, + gasAdjust: gasAdjust, + }, } for _, tC := range testCases { t.Run(tC.desc, func(t *testing.T) { diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index ffe10f135..60e214f89 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -337,7 +337,7 @@ func (d *HubClient) submitBatch(msgUpdateState *rollapptypes.MsgUpdateState) err err := retry.Do(func() error { txResp, err := d.client.BroadcastTx(d.config.DymAccountName, msgUpdateState) if err != nil || txResp.Code != 0 { - d.logger.Error("Error sending batch to settlement layer", "resp", txResp.RawLog, "error", err) + d.logger.Error("Error sending batch to settlement layer", "error", err) return err } return nil