polygon-cli
polygon-cli copied to clipboard
feat: gas manager for loadtest; add tx-gas-chart
closes https://github.com/0xPolygon/devtools/issues/444
This PR adds a Gas Manager to the loadtest command and introduces a new tx-gas-chart visualization tool.
Gas Manager features:
- Gas Vault: Budget-based throttling that controls transaction flow per block
- Wave Patterns: Five oscillation patterns (flat, sine, square, triangle, sawtooth) to simulate varying network conditions
- Gas Pricing Strategies: Three strategies (estimated, fixed, dynamic) for flexible gas price simulation
New tx-gas-chart command:
- Generates visual PNG charts analyzing transaction gas prices and limits across block ranges
- Displays four metrics: transaction gas prices, transaction gas limits, block gas limits, and block gas used
- Supports highlighting transactions from/to specific addresses
- Configurable scale (logarithmic or linear) for gas price visualization
- Useful for analyzing gas patterns during load tests or investigating network behavior
Use cases:
- Simulate realistic network congestion patterns during load tests
- Run infinite load tests with controlled gas consumption
- Visualize gas price and usage patterns across blocks
- Stress test networks with oscillating transaction loads