Module Configuration
The IBC Rate Limit module has a single parameter that specifies which CosmWasm contract handles rate limiting decisions.CLI Implementation Issue: The current CLI implementation has a bug that prevents the
neutron query rate-limited-ibc params
command from working. Use the REST endpoint instead: GET /neutron/ibc-rate-limit/v1beta1/params
Checking Current Parameters
To check the current contract address parameter via REST:Updating the Contract Address
To update the contract address, governance must submit an update-params proposal:Clearing the Contract Address
To disable rate limiting by clearing the contract address:Module Behavior
When Contract Address is Set
When a valid contract address is configured:- Send Operations: The module forwards packet information to the contract via
send_packet
message - Receive Operations: The module forwards packet information to the contract via
recv_packet
message - Failed Packets: The module automatically calls the contract’s
undo_send
function - Rate Limit Exceeded: If the contract returns an error containing “rate limit exceeded”, the transfer is blocked
When Contract Address is Empty
When no contract address is configured:- All IBC transfers proceed normally without any rate limiting
- The module acts as a pass-through middleware with no additional functionality
Error Handling
The module handles various error scenarios:Rate Limit Exceeded
Contract Error
Bad Revert Events
If the module fails to call the contract’s undo function for failed packets, it emits abad_revert
event:
Contract Requirements
For a CosmWasm contract to work with this module, it must implement the following sudo message handlers:Required Sudo Messages
- send_packet: Handle outgoing packet information
- recv_packet: Handle incoming packet information
- undo_send: Handle failed packet reversals
Rate Limiting Implementation: The actual rate limiting logic (quotas, time periods, flow tracking, etc.) is entirely contract-specific. The module only provides the packet forwarding mechanism and standardized message interface.
Monitoring and Debugging
Module Events
Monitor these events for module-specific issues:- bad_revert: Indicates the module failed to notify the contract about a failed packet
Contract Logs
Monitor contract logs for rate limiting decisions and any contract-specific events.Parameter Changes
Monitor governance proposals for contract address updates:Best Practices
- Test Contract Integration: Always test contract behavior in a test environment before governance updates
- Monitor Events: Set up monitoring for
bad_revert
events to detect contract communication issues - Governance Coordination: Coordinate contract address updates with contract deployments
- Emergency Procedures: Have procedures ready to clear the contract address if needed to restore transfer functionality