Skip to content

feat: implement gas price and gas limit customization for txsim #4447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 16, 2025

Conversation

jcstein
Copy link
Member

@jcstein jcstein commented Mar 24, 2025

Overview

Resolves #4445

Testing results

txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 360000 --gas-price 1.0

The fees were outrageous here - 16+ TIA. - example block

txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 720000 --gas-price 0.5

This fills 2MB with 8.25 TIA - example block

then using
txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 3600000 --gas-price 0.1

works and 2MB costs 1.65 TIA, much more reasonable - example block

Failed testing

this also failed but idk why

txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 18000000 --gas-price 0.02

Error: error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 72000 required at least: 360000.000000000000000000: insufficient fee

going lower

txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 12000000 --gas-price 0.03

Error: error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 108000 required at least: 360000.000000000000000000: insufficient fee

and up a bit:

txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 15000000 --gas-price 0.03

Error: error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 108000 required at least: 360000.000000000000000000: insufficient fee

@jcstein jcstein requested a review from a team as a code owner March 24, 2025 17:38
@jcstein jcstein requested review from cmwaters and evan-forbes and removed request for a team March 24, 2025 17:38
@jcstein jcstein changed the title Apply gas price and gas limit customization for txsim feat: implement gas price and gas limit customization for txsim Mar 24, 2025
Copy link
Contributor

coderabbitai bot commented Mar 24, 2025

📝 Walkthrough

"""

Walkthrough

The changes introduce configurable gas parameters in the txsim tool. Two new flags (--gas-limit and --gas-price) are added to the CLI to allow users to specify custom gas limits and prices. The Options struct is extended to hold these values, and the AccountManager is updated to use them during transaction submission. New setter methods in AccountManager and method chaining in Options ensure that the provided values are applied when a transaction is executed.

Changes

File(s) Change Summary
test/.../cli.go Added two global variables and corresponding CLI flags (--gas-limit and --gas-price); updated RunE to apply these values when greater than zero.
test/.../account.go Added gasLimit and gasPrice fields to the AccountManager; modified the Submit method to prioritize and apply these values for gas limit and gas price; introduced SetGasLimit and SetGasPrice methods; simplified the nextAccountName logic.
test/.../run.go Extended the Options struct with new fields (gasLimit and gasPrice); added WithGasLimit and WithGasPrice methods; modified Run to configure the AccountManager using these values.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant CLI as Command-Line Interface
    participant O as Options
    participant AM as AccountManager

    U->>CLI: Execute txsim with --gas-limit and --gas-price flags
    CLI->>O: Parse flags and set gasLimit and gasPrice
    O->>AM: Invoke WithGasLimit and WithGasPrice to pass custom values
    AM->>AM: Use custom gas settings during transaction submission (Submit)
Loading

Assessment against linked issues

Objective Addressed Explanation
Add --gas-limit and --gas-price flags and apply them in transaction submission (#4445)
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (1.64.8)

Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2
Failed executing command with error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9657d31 and 4c8a9f2.

📒 Files selected for processing (1)
  • test/cmd/txsim/cli.go (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/cmd/txsim/cli.go
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: test / test-race
  • GitHub Check: test / test-fuzz
  • GitHub Check: test / test-coverage
  • GitHub Check: test / test-short
  • GitHub Check: test / test
  • GitHub Check: lint / golangci-lint
  • GitHub Check: markdown-linter / markdown-link-check
  • GitHub Check: Summary

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/txsim/account.go (2)

230-245: Gas limit handling logic looks good but could be formatted better.

The implementation correctly handles the custom gas limit and properly calculates fees based on gas price. However, there's a formatting issue on line 233 that should be fixed.

- 			opts = append(opts, user.SetGasLimit(am.gasLimit))
- 			
+ 			opts = append(opts, user.SetGasLimit(am.gasLimit))
🧰 Tools
🪛 golangci-lint (1.64.8)

233-233: File is not properly formatted

(gofumpt)


248-255: Consider refactoring the if-else chain to a switch statement.

The current nested if-else structure works, but a switch statement would improve readability for this gas price determination logic.

- 		if op.GasPrice > 0 {
- 			opts = append(opts, user.SetFee(uint64(math.Ceil(float64(op.GasLimit)*op.GasPrice))))
- 		} else if am.gasPrice > 0 {
- 			// Use custom gas price set on AccountManager if available
- 			opts = append(opts, user.SetFee(uint64(math.Ceil(float64(op.GasLimit)*am.gasPrice))))
- 		} else {
- 			opts = append(opts, user.SetFee(uint64(math.Ceil(float64(op.GasLimit)*appconsts.DefaultMinGasPrice))))
- 		}
+ 		switch {
+ 		case op.GasPrice > 0:
+ 			opts = append(opts, user.SetFee(uint64(math.Ceil(float64(op.GasLimit)*op.GasPrice))))
+ 		case am.gasPrice > 0:
+ 			// Use custom gas price set on AccountManager if available
+ 			opts = append(opts, user.SetFee(uint64(math.Ceil(float64(op.GasLimit)*am.gasPrice))))
+ 		default:
+ 			opts = append(opts, user.SetFee(uint64(math.Ceil(float64(op.GasLimit)*appconsts.DefaultMinGasPrice))))
+ 		}
🧰 Tools
🪛 golangci-lint (1.64.8)

248-248: ifElseChain: rewrite if-else to switch statement

(gocritic)

🪛 GitHub Check: lint / golangci-lint

[failure] 248-248:
ifElseChain: rewrite if-else to switch statement (gocritic)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18a07e1 and 915b3a1.

📒 Files selected for processing (3)
  • test/cmd/txsim/cli.go (3 hunks)
  • test/txsim/account.go (3 hunks)
  • test/txsim/run.go (3 hunks)
🧰 Additional context used
🧬 Code Definitions (2)
test/txsim/account.go (3)
test/cmd/txsim/cli.go (2)
  • gasLimit (45-45)
  • gasPrice (46-46)
app/errors/insufficient_gas_price_test.go (2)
  • gasLimit (28-28)
  • gasPrice (30-30)
test/txsim/sequence.go (1)
  • DefaultGasLimit (47-47)
test/cmd/txsim/cli.go (1)
test/txsim/account.go (1)
  • gasPrice (235-235)
🪛 golangci-lint (1.64.8)
test/txsim/account.go

248-248: ifElseChain: rewrite if-else to switch statement

(gocritic)


233-233: File is not properly formatted

(gofumpt)

🪛 GitHub Check: lint / golangci-lint
test/txsim/account.go

[failure] 248-248:
ifElseChain: rewrite if-else to switch statement (gocritic)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test / test
  • GitHub Check: Summary
🔇 Additional comments (9)
test/txsim/run.go (3)

69-77: Feature implementation looks good!

These checks appropriately apply custom gas limit and gas price from the options to the account manager if provided. The conditional structure ensures these configurations are only set when explicitly specified by the user (values > 0).


145-146: Good addition of fields to Options struct.

The additions of gasLimit and gasPrice fields to the Options struct are well-aligned with the PR objective of allowing customization of gas parameters.


189-197: Well-designed method chaining for gas configuration.

These new methods follow the existing pattern of method chaining in the Options struct, providing a clean API for configuring gas parameters. This implementation approach maintains consistency with the rest of the codebase.

test/txsim/account.go (3)

35-36: Appropriate addition of gas configuration fields.

Adding gasLimit and gasPrice fields to the AccountManager struct aligns with the PR objective of supporting customizable gas parameters.


431-434: Simplified function - good improvement.

Simplifying the nextAccountName method by removing the mutex lock is a good improvement. Since this method is only incrementing a counter and returning a string, the lock wasn't necessary in this context.


437-444: Well-designed setter methods for gas parameters.

These setter methods follow good Go practices and provide a clean API for setting gas parameters on the account manager.

test/cmd/txsim/cli.go (3)

45-46: Good addition of gas parameter variables.

Adding gasLimit and gasPrice as global variables is consistent with the pattern used for other configuration parameters in this file.


182-188: Clear and consistent handling of gas parameters.

The implementation properly checks if custom values were provided before applying them to the options, following the same pattern used for other optional parameters.


230-231: Well-documented CLI flags for gas parameters.

The flag descriptions clearly explain the purpose and default behavior of the gas limit and gas price parameters. The "(0 = auto-estimate)" and "(0 = use default)" notes are particularly helpful for users.

@rootulp
Copy link
Collaborator

rootulp commented Mar 24, 2025

rootulp
rootulp previously approved these changes Mar 24, 2025
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One idea for an optional refactor to make it easier to reason about the fee calculation

Comment on lines 234 to 241
// Calculate fee based on gas price
var gasPrice float64
if am.gasPrice > 0 {
gasPrice = am.gasPrice
} else {
gasPrice = appconsts.DefaultMinGasPrice
}
opts = append(opts, user.SetFee(uint64(math.Ceil(float64(am.gasLimit)*gasPrice))))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] this seems a bit difficult to reason about. Is it possible to extract the fee calculation to after the custom gas limit and gas price have been set. That way this code can remain less indented:

if am.gasLimit > 0 {
    // set custom gas limit
}

if am.gasPrice > 0 {
  // set custom gas price
}

fee := calculateFee(gasLimit, gasPrice)
opts = append(opts, user.SetFee(fee))

That way there's only one line where we set the fee instead of two.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for the feedback! 36d2c38

rach-id
rach-id previously approved these changes Mar 24, 2025
Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utack

@jcstein jcstein dismissed stale reviews from rach-id and rootulp via 36d2c38 March 24, 2025 21:45
@jcstein
Copy link
Member Author

jcstein commented Mar 24, 2025

tested with txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 3600000 --gas-price 0.1, example block

@celestia-bot celestia-bot requested review from rach-id and rootulp March 24, 2025 21:45
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/txsim/account.go (2)

229-266: Consider simplifying the fee calculation logic.

The implementation correctly prioritizes gas parameters (op-specific → account manager → defaults) and includes appropriate warnings for low gas prices. However, the nested conditionals for fee calculation could be simplified.

Per rootulp's previous suggestion, consider extracting the fee calculation after both gas parameters are determined:

-	var gasLimit, fee uint64
+	var gasLimit uint64
 	var gasPrice float64

 	// Determine gas limit
 	switch {
 	case op.GasLimit > 0:
 		gasLimit = op.GasLimit
 	case am.gasLimit > 0:
 		gasLimit = am.gasLimit
 	default:
 		gasLimit = DefaultGasLimit
-		fee = defaultFee
 	}

 	// Set gas limit
 	if gasLimit > 0 {
 		opts = append(opts, user.SetGasLimit(gasLimit))
 	}

 	// Determine gas price and calculate fee if not already set
-	if fee == 0 {
-		switch {
-		case op.GasPrice > 0:
-			gasPrice = op.GasPrice
-		case am.gasPrice > 0:
-			gasPrice = am.gasPrice
-			if gasPrice < appconsts.DefaultMinGasPrice {
-				log.Warn().
-					Float64("gas_price", gasPrice).
-					Float64("default_min_gas_price", appconsts.DefaultMinGasPrice).
-					Msg("custom gas price is lower than default minimum")
-			}
-		default:
-			gasPrice = appconsts.DefaultMinGasPrice
-		}
-		fee = uint64(math.Ceil(float64(gasLimit) * gasPrice))
-		opts = append(opts, user.SetFee(fee))
+	// Determine gas price
+	switch {
+	case op.GasPrice > 0:
+		gasPrice = op.GasPrice
+	case am.gasPrice > 0:
+		gasPrice = am.gasPrice
+		if gasPrice < appconsts.DefaultMinGasPrice {
+			log.Warn().
+				Float64("gas_price", gasPrice).
+				Float64("default_min_gas_price", appconsts.DefaultMinGasPrice).
+				Msg("custom gas price is lower than default minimum")
+		}
+	default:
+		gasPrice = appconsts.DefaultMinGasPrice
 	}
+	
+	// Calculate and set fee
+	fee := uint64(math.Ceil(float64(gasLimit) * gasPrice))
+	opts = append(opts, user.SetFee(fee))

This approach is cleaner, has less indentation, and avoids conditional fee calculation.


446-454: Consider adding validation to the setter methods.

The methods correctly implement the functionality to set custom gas parameters, but they don't validate inputs.

Consider adding validation to prevent negative or unreasonable values:

 // SetGasLimit sets a custom gas limit to be used for all transactions
 func (am *AccountManager) SetGasLimit(gasLimit uint64) {
+	if gasLimit == 0 {
+		log.Warn().Msg("setting gas limit to zero may cause transactions to fail")
+	}
 	am.gasLimit = gasLimit
 }

 // SetGasPrice sets a custom gas price to be used for all transactions
 func (am *AccountManager) SetGasPrice(gasPrice float64) {
+	if gasPrice <= 0 {
+		log.Warn().Msg("setting non-positive gas price will cause transactions to fail")
+	} else if gasPrice < appconsts.DefaultMinGasPrice {
+		log.Warn().
+			Float64("gas_price", gasPrice).
+			Float64("default_min_gas_price", appconsts.DefaultMinGasPrice).
+			Msg("custom gas price is lower than default minimum")
+	}
 	am.gasPrice = gasPrice
 }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 915b3a1 and 36d2c38.

📒 Files selected for processing (1)
  • test/txsim/account.go (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: test / test
  • GitHub Check: test / test-race
  • GitHub Check: Summary
🔇 Additional comments (2)
test/txsim/account.go (2)

35-36: LGTM: New fields support gas customization.

These new fields appropriately extend the AccountManager to store custom gas parameters, supporting the core feature of this PR.


441-444:

✅ Verification successful

Verify thread safety of accountIndex modifications.

The mutex lock was removed from this method, which simplifies the code but could introduce thread safety issues if the method is called concurrently.


🏁 Script executed:

#!/bin/bash
# Check if nextAccountName is called from any methods other than AllocateAccounts
echo "Searching for calls to nextAccountName outside of AllocateAccounts..."
rg "nextAccountName\(\)" --type go -A 3 -B 3 | grep -v "AllocateAccounts"

Length of output: 1010


Thread Safety Verification and Documentation

The search confirmed that the only usage of nextAccountName is within a non-concurrent context (specifically, within the loop in AllocateAccounts, which is already documented as not concurrently safe). Thus, removing the mutex lock is acceptable given the current usage. However, please consider updating the documentation or adding a comment to clearly state that this method is not safe for concurrent calls, so future modifications or usages are aware of this constraint.

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still a little confused on why this calculates fee in the middle of setting gas limit and gas price. IMO the code could be clearer if it:

  1. Determine gas limit (either user specified or default)
  2. Determine gas price (either user specified or default)
  3. Calculate fee based on gas limit and gas price from step 1 and 2

I haven't tried any of this code and it's mostly for testing purposes so if this works then I'm okay with merging it

- Separate gas limit, price and fee calculation into clear steps\n- Remove redundant default fee calculation\n- Improve code readability and maintainability
@celestia-bot celestia-bot requested a review from rootulp March 25, 2025 15:06
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks for addressing the feedback

@rootulp
Copy link
Collaborator

rootulp commented Mar 25, 2025

FYI golangci-lint is failing but it wasn't caused by this PR: #4454 will fix separately.

@evan-forbes evan-forbes enabled auto-merge (squash) March 28, 2025 20:38
@evan-forbes evan-forbes added the backport:v3.x PR will be backported automatically to the v3.x branch upon merging label Mar 28, 2025
@jcstein
Copy link
Member Author

jcstein commented Mar 28, 2025

The gas limit is a bit of strange add because txsim commonly is used for simulating multiple types of transactions at once all requiring different amounts of gas. @jcstein was there a specific use case for wanting to set the gas limit? I can understand the gas price.

I will trust core/app team and your judgement here @cmwaters! In #4445 I hit issues with error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 7200 required at least: 360000.000000000000000000: insufficient fee, but did not try to work this out using just ability to set gas limit. want to rework it?

@rach-id
Copy link
Member

rach-id commented Mar 29, 2025

Proposition:

Why not use the gas estimation endpoint in txsim? would be a good stress test for it every time someone runs it, and it should return accurate results.

@jcstein
Copy link
Member Author

jcstein commented Apr 1, 2025

I'm not sure what's best here. I'd defer to core/app team to take this over if possible, I just was trying to use txsim and it didn't work without changing the minimum gas price to be enough compared to what the endpoint is asking for

evan-forbes
evan-forbes previously approved these changes Apr 1, 2025
rootulp
rootulp previously approved these changes Apr 2, 2025
@jcstein
Copy link
Member Author

jcstein commented Apr 2, 2025

I'm still a bit concerned this implementation is wrong, even though it "works"

@cmwaters
Copy link
Contributor

Why not use the gas estimation endpoint in txsim? would be a good stress test for it every time someone runs it, and it should return accurate results.

Eventually we should. But I think allowing to manually set it is also good. We should open an issue for it

@cmwaters cmwaters dismissed stale reviews from rootulp and evan-forbes via 4af515b April 16, 2025 09:07
@cmwaters
Copy link
Contributor

I hit issues with error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 7200 required at least: 360000.000000000000000000: insufficient fee,

Yeah this is from the gas price being insufficient

cmwaters
cmwaters previously approved these changes Apr 16, 2025
@evan-forbes evan-forbes merged commit ba3a448 into celestiaorg:main Apr 16, 2025
30 checks passed
mergify bot pushed a commit that referenced this pull request Apr 16, 2025
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

Resolves #4445

<!--
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue.
-->

## Testing results

`txsim --key-path ~/.celestia-app --grpc-endpoint
validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4
--blob-amounts 1 --blob-sizes 475000 --gas-limit 360000 --gas-price 1.0`

The fees were outrageous here - 16+ TIA. - [example
block](https://arabica.celenium.io/block/4973806?tab=transactions)

`txsim --key-path ~/.celestia-app --grpc-endpoint
validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4
--blob-amounts 1 --blob-sizes 475000 --gas-limit 720000 --gas-price 0.5`

This fills 2MB with 8.25 TIA - [example
block](https://arabica.celenium.io/block/4973865?tab=transactions)

then using
`txsim --key-path ~/.celestia-app --grpc-endpoint
validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4
--blob-amounts 1 --blob-sizes 475000 --gas-limit 3600000 --gas-price
0.1`

works and 2MB costs 1.65 TIA, much more reasonable - [example
block](https://arabica.celenium.io/block/4973906?tab=transactions)

### Failed testing

this also failed but idk why
```
txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 18000000 --gas-price 0.02

Error: error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 72000 required at least: 360000.000000000000000000: insufficient fee
```

going lower
```
txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 12000000 --gas-price 0.03

Error: error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 108000 required at least: 360000.000000000000000000: insufficient fee
```

and up a bit:
```
txsim --key-path ~/.celestia-app --grpc-endpoint validator-1.celestia-arabica-11.com:9090 --feegrant --blob 4 --blob-amounts 1 --blob-sizes 475000 --gas-limit 15000000 --gas-price 0.03

Error: error funding accounts: broadcast tx error: insufficient minimum gas price for this node; got: 108000 required at least: 360000.000000000000000000: insufficient fee
```

---------

Co-authored-by: Rootul P <[email protected]>
(cherry picked from commit ba3a448)

# Conflicts:
#	test/cmd/txsim/cli.go
#	test/txsim/run.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:v3.x PR will be backported automatically to the v3.x branch upon merging external
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: add gas-limit and gas-price flags to txsim
5 participants