diff --git a/Cargo.lock b/Cargo.lock index 07a83f2..e8001ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,9 +188,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.24" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -246,7 +246,7 @@ checksum = "1b5658b1dc64e10b56ae7a449f678f96932a96f6cfad1769d608d1d1d656480a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -352,7 +352,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -410,7 +410,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "unicode-xid", ] @@ -614,9 +614,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "memchr" @@ -654,12 +654,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "p256" @@ -685,12 +682,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -711,9 +702,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -822,7 +813,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -846,9 +837,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -864,13 +855,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -881,14 +872,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -962,9 +953,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -973,22 +964,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1039,7 +1030,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1059,7 +1050,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] diff --git a/broadcast/broadcast.go b/broadcast/broadcast.go index 3562103..4716430 100644 --- a/broadcast/broadcast.go +++ b/broadcast/broadcast.go @@ -23,7 +23,8 @@ type TimingMetrics struct { Position int } -func (t *TimingMetrics) LogTiming(sequence uint64, success bool, err error) { +func (t *TimingMetrics) LogTiming(sequence uint64, txHash string, success bool, err error) { + timeFormat := "2006-01-02 15:04:05.000" prepTime := t.SignStart.Sub(t.PrepStart) signTime := t.BroadStart.Sub(t.SignStart) broadcastTime := t.Complete.Sub(t.BroadStart) @@ -34,15 +35,21 @@ func (t *TimingMetrics) LogTiming(sequence uint64, success bool, err error) { status = "FAILED" } - fmt.Printf("[POS-%d] %s Transaction %s: seq=%d prep=%v sign=%v broadcast=%v total=%v%s\n", + txStatus := "" + if txHash != "" { + txStatus = fmt.Sprintf(" txhash=%s", txHash) + } + + fmt.Printf("[POS-%d] [%s] %s seq=%d prep=%v sign=%v broadcast=%v total=%v%s%s\n", t.Position, - time.Now().Format("15:04:05.000"), + time.Now().Format(timeFormat), status, sequence, prepTime, signTime, broadcastTime, totalTime, + txStatus, formatError(err)) } @@ -81,6 +88,10 @@ func Loop( responseCodes = make(map[uint32]int) sequence := txParams.Sequence + txParams.Config.Logger.Info("Starting transaction loop", + "position", position, + "batch_size", batchSize) + for i := 0; i < batchSize; i++ { currentSequence := sequence metrics := &TimingMetrics{ @@ -94,7 +105,7 @@ func Loop( metrics.Complete = time.Now() if err != nil { - metrics.LogTiming(currentSequence, false, err) + metrics.LogTiming(currentSequence, "", false, err) failedTxns++ if resp != nil && resp.Code == 32 { @@ -109,10 +120,17 @@ func Loop( continue } - metrics.LogTiming(currentSequence, true, nil) + metrics.LogTiming(currentSequence, "", true, nil) successfulTxns++ responseCodes[resp.Code]++ sequence++ + + if resp.Code == 0 { + txParams.Config.Logger.Info("Transaction successful", + "txhash", resp.Hash, + "sequence", sequence, + "position", position) + } } updatedSequence = sequence @@ -140,10 +158,10 @@ func handleSequenceMismatch(txParams types.TransactionParams, position int, sequ metrics.Complete = time.Now() if err != nil { - metrics.LogTiming(expectedSeq, false, err) + metrics.LogTiming(expectedSeq, "", false, err) return expectedSeq, false, nil } - metrics.LogTiming(expectedSeq, true, nil) + metrics.LogTiming(expectedSeq, "", true, nil) return expectedSeq + 1, true, resp } diff --git a/broadcast/client.go b/broadcast/client.go index fb04f17..dff1951 100644 --- a/broadcast/client.go +++ b/broadcast/client.go @@ -3,16 +3,20 @@ package broadcast import ( "context" "fmt" + "log" + "net/http" "sync" "time" cometrpc "github.com/cometbft/cometbft/rpc/client/http" coretypes "github.com/cometbft/cometbft/rpc/core/types" - tmtypes "github.com/cometbft/cometbft/types" + "github.com/prometheus/client_golang/prometheus" ) type Client struct { - client *cometrpc.HTTP + client *cometrpc.HTTP + pool chan *cometrpc.HTTP + metrics *ClientMetrics } var ( @@ -20,6 +24,8 @@ var ( clientsMux sync.RWMutex ) +const maxPoolSize = 100 + func GetClient(rpcEndpoint string) (*Client, error) { clientsMux.RLock() if client, exists := clients[rpcEndpoint]; exists { @@ -28,41 +34,129 @@ func GetClient(rpcEndpoint string) (*Client, error) { } clientsMux.RUnlock() - // If client doesn't exist, acquire write lock and create it clientsMux.Lock() defer clientsMux.Unlock() - // Double-check after acquiring write lock if client, exists := clients[rpcEndpoint]; exists { return client, nil } - // Create new client - cmtCli, err := cometrpc.New(rpcEndpoint, "/websocket") - if err != nil { - return nil, err + // Create connection pool + pool := make(chan *cometrpc.HTTP, maxPoolSize) + for i := 0; i < maxPoolSize; i++ { + // Add HTTP client configuration + config := &http.Client{ + Transport: &http.Transport{ + MaxIdleConns: 200, + MaxIdleConnsPerHost: 100, + IdleConnTimeout: 30 * time.Second, + DisableKeepAlives: false, + ForceAttemptHTTP2: true, + MaxConnsPerHost: 200, + }, + Timeout: 10 * time.Second, + } + + cmtCli, err := cometrpc.NewWithClient(rpcEndpoint, "/websocket", config) + if err != nil { + return nil, err + } + pool <- cmtCli } client := &Client{ - client: cmtCli, + pool: pool, } clients[rpcEndpoint] = client return client, nil } +type ClientMetrics struct { + poolGetLatency prometheus.Histogram + poolReturnLatency prometheus.Histogram + rpcLatency prometheus.Histogram +} + func (b *Client) Transaction(txBytes []byte) (*coretypes.ResultBroadcastTx, error) { - ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) + metrics := &BroadcastMetrics{ + Start: time.Now(), + PoolGetStart: time.Time{}, + RpcCallStart: time.Time{}, + PoolReturnStart: time.Time{}, + Complete: time.Time{}, + } + defer metrics.LogTiming("") + + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - t := tmtypes.Tx(txBytes) - res, err := b.client.BroadcastTxSync(ctx, t) - if err != nil { - return nil, err + // Get client from pool with timeout + metrics.PoolGetStart = time.Now() + select { + case client := <-b.pool: + if b.metrics != nil { + b.metrics.poolGetLatency.Observe(time.Since(metrics.PoolGetStart).Seconds()) + } + + // Execute RPC call + metrics.RpcCallStart = time.Now() + result, err := client.BroadcastTxSync(ctx, txBytes) + if b.metrics != nil { + b.metrics.rpcLatency.Observe(time.Since(metrics.RpcCallStart).Seconds()) + } + + // Return client to pool with timeout + metrics.PoolReturnStart = time.Now() + select { + case b.pool <- client: + if b.metrics != nil { + b.metrics.poolReturnLatency.Observe(time.Since(metrics.PoolReturnStart).Seconds()) + } + case <-time.After(100 * time.Millisecond): + log.Printf("Warning: Client pool return timed out after 100ms") + } + + metrics.Complete = time.Now() + return result, err + + case <-ctx.Done(): + metrics.Complete = time.Now() + return nil, fmt.Errorf("timeout waiting for client from pool: %v", ctx.Err()) + } +} + +type BroadcastMetrics struct { + Start time.Time + PoolGetStart time.Time + RpcCallStart time.Time + PoolReturnStart time.Time + Complete time.Time +} + +func (m *BroadcastMetrics) LogTiming(txHash string) { + timeFormat := "2006-01-02 15:04:05.000" + poolGetTime := m.RpcCallStart.Sub(m.PoolGetStart) + rpcCallTime := m.PoolReturnStart.Sub(m.RpcCallStart) + poolReturnTime := m.Complete.Sub(m.PoolReturnStart) + totalTime := m.Complete.Sub(m.Start) + + status := "SUCCESS" + if txHash == "" { + status = "FAILED" } - if res.Code != 0 { - return res, fmt.Errorf("broadcast error code %d: %s", res.Code, res.Log) + txStatus := "" + if txHash != "" { + txStatus = fmt.Sprintf(" txHash=%s", txHash) } - return res, nil + log.Printf("[%s] %s: pool_get=%v rpc_call=%v pool_return=%v total=%v%s", + m.Start.Format(timeFormat), + status, + poolGetTime, + rpcCallTime, + poolReturnTime, + totalTime, + txStatus, + ) } diff --git a/broadcast/transaction.go b/broadcast/transaction.go index 89b12ea..dfdbc81 100644 --- a/broadcast/transaction.go +++ b/broadcast/transaction.go @@ -74,10 +74,23 @@ func BuildAndSignTransaction( return nil, err } - // Estimate gas limit + // Estimate gas limit with a buffer txSize := len(msg.String()) - gasLimit := uint64(int64(txSize)*txParams.Config.GasPerByte + txParams.Config.BaseGas) - txBuilder.SetGasLimit(gasLimit) + baseGas := txParams.Config.BaseGas + gasPerByte := txParams.Config.GasPerByte + + // Calculate estimated gas + estimatedGas := uint64(int64(txSize)*gasPerByte + baseGas) + + // Add a buffer (e.g., 20%) + buffer := uint64(float64(estimatedGas) * 0.2) + gasLimit := estimatedGas + buffer + + if txParams.Config.Gas.Limit > 0 { + txBuilder.SetGasLimit(uint64(txParams.Config.Gas.Limit)) + } else { + txBuilder.SetGasLimit(gasLimit) + } // Calculate fee gasPrice := sdk.NewDecCoinFromDec( diff --git a/go.mod b/go.mod index 368bdf8..d95a940 100644 --- a/go.mod +++ b/go.mod @@ -66,7 +66,7 @@ require ( cosmossdk.io/core v0.11.1 // indirect cosmossdk.io/depinject v1.0.0 // indirect cosmossdk.io/errors v1.0.1 // indirect - cosmossdk.io/log v1.4.1 // indirect + cosmossdk.io/log v1.4.1 cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1 // indirect cosmossdk.io/x/tx v0.13.5 // indirect @@ -164,7 +164,7 @@ require ( github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // 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.20.4 // indirect + github.com/prometheus/client_golang v1.20.4 github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.59.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect diff --git a/main.go b/main.go index af1048a..9749775 100644 --- a/main.go +++ b/main.go @@ -4,11 +4,11 @@ import ( "context" "errors" "fmt" - "log" "os" "sync" "time" + "cosmossdk.io/log" "github.com/BurntSushi/toml" "github.com/somatic-labs/meteorite/broadcast" "github.com/somatic-labs/meteorite/client" @@ -26,14 +26,18 @@ const ( ) func main() { + logger := log.NewLogger(os.Stdout) + config := types.Config{} if _, err := toml.DecodeFile("nodes.toml", &config); err != nil { - log.Fatalf("Failed to load config: %v", err) + logger.Error("Failed to load config", "error", err) } + config.Logger = logger + mnemonic, err := os.ReadFile("seedphrase") if err != nil { - log.Fatalf("Failed to read seed phrase: %v", err) + logger.Error("Failed to read seed phrase", "error", err) } // Set Bech32 prefixes and seal the configuration once @@ -46,7 +50,7 @@ func main() { positions := config.Positions const MaxPositions = 100 // Adjust based on requirements if positions <= 0 || positions > MaxPositions { - log.Fatalf("Number of positions must be between 1 and %d, got: %d", MaxPositions, positions) + logger.Error("Number of positions must be between 1 and %d, got: %d", MaxPositions, positions) } fmt.Println("Positions", positions) @@ -55,7 +59,7 @@ func main() { position := uint32(i) privKey, pubKey, acctAddress := lib.GetPrivKey(config, mnemonic, position) if privKey == nil || pubKey == nil || len(acctAddress) == 0 { - log.Fatalf("Failed to generate keys for position %d", position) + logger.Error("Failed to generate keys for position %d", "position", position) } accounts = append(accounts, types.Account{ PrivKey: privKey, @@ -74,7 +78,7 @@ func main() { // Get balances and ensure they are within 10% of each other balances, err := lib.GetBalances(accounts, config) if err != nil { - log.Fatalf("Failed to get balances: %v", err) + logger.Error("Failed to get balances", "error", err) } // Print addresses and balances @@ -82,7 +86,7 @@ func main() { for _, acct := range accounts { balance, err := lib.GetAccountBalance(acct.Address, config) if err != nil { - log.Printf("Failed to get balance for %s: %v", acct.Address, err) + logger.Error("Failed to get balance", "address", acct.Address, "error", err) continue } fmt.Printf("Position %d: Address: %s, Balance: %s %s\n", acct.Position, acct.Address, balance.String(), config.Denom) @@ -93,7 +97,7 @@ func main() { if !lib.CheckBalancesWithinThreshold(balances, 0.10) { fmt.Println("Account balances are not within 10% of each other. Adjusting balances...") if err := handleBalanceAdjustment(accounts, balances, config); err != nil { - log.Fatalf("Failed to handle balance adjustment: %v", err) + logger.Error("Failed to handle balance adjustment", "error", err) } } @@ -101,7 +105,7 @@ func main() { chainID, err := lib.GetChainID(nodeURL) if err != nil { - log.Fatalf("Failed to get chain ID: %v", err) + logger.Error("Failed to get chain ID", "error", err) } msgParams := config.MsgParams @@ -121,7 +125,7 @@ func main() { // Get account info sequence, accNum, err := lib.GetAccountInfo(acct.Address, config) if err != nil { - log.Printf("Failed to get account info for %s: %v", acct.Address, err) + logger.Error("Failed to get account info", "address", acct.Address, "error", err) return } @@ -336,23 +340,18 @@ func TransferFunds(sender types.Account, receiverAddress string, amount sdkmath. resp, _, err := broadcast.SendTransactionViaGRPC(ctx, txParams, sequence, grpcClient) if err != nil { - fmt.Printf("Transaction failed: %v\n", err) - - // Check if the error is a sequence mismatch error (code 32) - if resp != nil && resp.Code == 32 { - expectedSeq, parseErr := lib.ExtractExpectedSequence(resp.RawLog) - if parseErr != nil { - return fmt.Errorf("failed to parse expected sequence: %v", parseErr) - } - - // Update sequence and retry - sequence = expectedSeq - txParams.Sequence = sequence - fmt.Printf("Sequence mismatch detected. Updating sequence to %d and retrying...\n", sequence) - continue - } + config.Logger.Error("Transaction failed", + "error", err, + "sequence", sequence) + } else if resp != nil && resp.Code == 0 { + config.Logger.Info("Transaction successful", + "txhash", resp.TxHash, + "sequence", sequence, + "gas_used", resp.GasUsed) + } - return fmt.Errorf("failed to send transaction: %v", err) + if resp.Code == 0 { + fmt.Printf("Transaction successful - TxHash: %s\n", resp.TxHash) } if resp.Code != 0 { @@ -372,6 +371,25 @@ func TransferFunds(sender types.Account, receiverAddress string, amount sdkmath. continue } + // Assuming you are inside the loop where you handle the transaction response + if resp.Code == 41 { + fmt.Printf("Transaction failed with code %d: %s\n", resp.Code, resp.RawLog) + maxBlockGas := 75000000 + newGasLimit := maxBlockGas - 1000000 + txParams.Config.Gas.Limit = int64(newGasLimit) + fmt.Printf("Reducing gas limit to %d and retrying...\n", newGasLimit) + + // Retry sending the transaction + resp, _, err = broadcast.SendTransactionViaGRPC(ctx, txParams, sequence, grpcClient) + if resp.Code != 0 { + fmt.Printf("Transaction failed with code %d: %s\n", resp.Code, resp.RawLog) + continue + } + if err != nil { + return fmt.Errorf("failed to send transaction: %v", err) + } + } + return fmt.Errorf("transaction failed with code %d: %s", resp.Code, resp.RawLog) } diff --git a/modules/bank/send.go b/modules/bank/send.go index f7f856a..96cf1e9 100644 --- a/modules/bank/send.go +++ b/modules/bank/send.go @@ -20,7 +20,7 @@ func CreateBankSendMsg(config types.Config, fromAddress string, msgParams types. toAccAddress, err := sdk.AccAddressFromBech32(msgParams.ToAddress) if err != nil { - fmt.Println("invalid to address, spamming random new accounts") + // fmt.Println("invalid to address, in nodes.toml, automatically spamming random new accounts") toAccAddress, err = lib.GenerateRandomAccount() if err != nil { return nil, "", fmt.Errorf("error generating random account: %w", err) diff --git a/nodes.toml b/nodes.toml index 0f12087..406cace 100644 --- a/nodes.toml +++ b/nodes.toml @@ -5,8 +5,7 @@ channel = "channel-1" denom = "uom" prefix = "mantra" gas_per_byte = 100 -base_gas = 200000 -ibc_memo = "Contract store spam test" +base_gas = 170000 memo = "Storing compiled contract with randomized memo" ibc_memo_repeat = 10 rand_min = 15000 @@ -14,7 +13,7 @@ rand_max = 30000 revision_number = 4 timeout_height = 21720608 slip44 = 118 -positions = 50 # Number of positions to use from the seed phrase +positions = 100 # Number of positions to use from the seed phrase broadcast_mode = "grpc" # or "rpc" @@ -43,8 +42,14 @@ label = "statefilestore" [gas] low = 25 precision = 3 +# limit = 75000000 [nodes] rpc = ["http://127.0.0.1:26657"] api = "http://localhost:1317" grpc = "localhost:9090" + + +## IBC Transfer +# msg_type = "ibc_transfer" +ibc_memo = "Contract store spam test" diff --git a/types/types.go b/types/types.go index 1b00810..47fd0aa 100644 --- a/types/types.go +++ b/types/types.go @@ -1,6 +1,10 @@ package types -import cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +import ( + "cosmossdk.io/log" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" +) type Header struct { Height string `json:"height"` @@ -117,6 +121,7 @@ type Fee struct { } type Config struct { + Logger log.Logger `toml:"logger"` Bytes int64 `toml:"bytes"` Chain string `toml:"chain"` Channel string `toml:"channel"` @@ -162,6 +167,7 @@ type GasConfig struct { Medium int64 `toml:"medium"` High int64 `toml:"high"` Precision int64 `toml:"precision"` + Limit int64 `toml:"limit"` // to be set entirely by software } type NodesConfig struct {