-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: update cosmos gas price to 5*1e9 #903
Conversation
WalkthroughThis pull request introduces a comprehensive update to the minimum gas prices across multiple configuration files and related test cases. The changes involve modifying the default gas price from 4,000 to 5 in various components, including configuration files for mainnet, testnet, and server settings. The modifications are consistent across different files, updating the Changes
Possibly related PRs
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
client/client_test.go
(3 hunks)cmd/config.go
(2 hunks)cmd/config_test.go
(2 hunks)public/mainnet/app.toml
(1 hunks)public/testnet/app.toml
(1 hunks)server/config/data/app.json
(1 hunks)types/constant.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Mergify Merge Protections
- GitHub Check: Summary
🔇 Additional comments (7)
types/constant.go (1)
55-55
: Verify the impact of gas price reduction.The gas price has been significantly reduced from 4,000 * 1e9 to 5 * 1e9 apundiai. This is a breaking change that will affect transaction costs across the network.
Let's verify the usage and impact:
✅ Verification successful
Gas price change aligns with network configuration
The change from 4,000 * 1e9 to 5 * 1e9 apundiai in GetDefGasPrice() aligns with the minimum gas prices (5000000000apundiai) configured in both testnet and mainnet app.toml files. This change simplifies the code by using the same value that's already in production use.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any hardcoded gas price values that might need updating # Search for any remaining references to the old gas price rg -i "4000.*1e9|4_000.*1e9" # Search for potential gas price configurations in config files rg -g "*.{toml,json,yaml,yml}" "minimum-gas-prices"Length of output: 66932
Script:
#!/bin/bash # Search for gas price related patterns and constants rg -i "gas.*price|gasPrice" # Find imports of the constant package rg -g "*.go" "\".*types/constant\""Length of output: 80497
cmd/config.go (1)
14-14
: LGTM! Good use of centralized configuration.The change correctly uses GetDefGasPrice() instead of hardcoding values, ensuring consistency across the codebase.
Also applies to: 56-56
cmd/config_test.go (1)
21-21
: LGTM! Tests properly updated.The test configuration correctly uses GetDefGasPrice() instead of hardcoding values, making the tests more maintainable.
Also applies to: 102-102
client/client_test.go (2)
333-333
: LGTM! Gas price test properly updated.The test case correctly expects the new gas price of 5 * 1e9.
378-378
: Verify the balance amount changes.The balance amount changes from 488999 * 1e18 to 48899999875 * 1e13 seem unrelated to the gas price update. Please confirm if these changes are intentional.
Also applies to: 401-401
✅ Verification successful
Test expectations updated with more precise balance values
The changes are in test expectations only, where the value was adjusted from 488,999 * 1e18 to 48,899,999,875 * 1e13. Both represent approximately 488,999 tokens with a negligible difference (~0.0002%). This appears to be an intentional precision adjustment in the test cases.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for related balance amount changes # Search for similar balance amounts in tests rg "488999|48899999875" # Search for potential balance configurations rg -g "*.{toml,json,yaml,yml}" "balance.*488999|balance.*48899999875"Length of output: 252
Script:
#!/bin/bash # Search for the original balance value with context rg -B 5 -A 5 "488999.*1e18|48899999875.*1e13" client/client_test.go # Search for test setup and related balance calculations ast-grep --pattern 'func Test$_($_) { $$$ Amount: $_ $$$ }'Length of output: 681
Script:
#!/bin/bash # Search for test setup and related constants rg -B 5 -A 5 "func.*Setup|const.*Amount" client/client_test.go # Look for any other similar balance calculations ast-grep --pattern 'Amount: sdkmath.NewInt($_).MulRaw($_)'Length of output: 420
server/config/data/app.json (1)
69-69
: Verify the impact of gas price reduction.The minimum gas price has been significantly reduced from 40001e9 to 51e9. While the change is consistent across all environments, this reduction might affect:
- Network economics
- Spam prevention mechanisms
- Validator profitability
✅ Verification successful
Gas price reduction is consistently configured across environments
The gas price change from 40001e9 to 51e9 apundiai is verified to be consistently applied across all environments:
- Mainnet configuration
- Testnet configuration
- Server configuration
While this represents a significant reduction, it appears to be an intentional network-wide parameter change rather than an inconsistency or error.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for any hardcoded gas prices in the codebase that might need updating echo "Searching for hardcoded gas prices..." rg -i "4000000000000" --type go # Check for token denomination usage echo "Checking token denomination usage..." rg -i "FX.*minimum.gas" --type-add 'config:*.{toml,json}' --type config rg -i "apundiai.*minimum.gas" --type-add 'config:*.{toml,json}' --type configLength of output: 111187
Script:
#!/bin/bash # Search for gas price patterns in various formats echo "Searching for gas price patterns..." rg -i "minimum.gas.price|min.gas.price|min-gas-price" --type-add 'config:*.{toml,json,yaml}' --type config # Search for gas price values in scientific notation and regular format echo "Searching for gas price values..." rg -i "([0-9]+e\+?[0-9]+|[0-9]+).*apundiai" --type-add 'config:*.{toml,json,yaml}' --type config # Check for governance proposals related to gas prices echo "Checking governance proposals..." rg -i "gas.price|minimum.gas" --type md --type goLength of output: 6793
public/testnet/app.toml (1)
11-11
: Confirm testnet alignment with mainnet changes.The gas price and denomination changes in testnet match the mainnet configuration, which is good for consistency. However, ensure that:
- Testnet validators are notified of these changes
- A testing period is planned to validate the new gas prices
- Documentation is updated to reflect these changes
Summary by CodeRabbit
Release Notes
Configuration Updates
Testing
System Changes