Add bounded live bot and tester scenarios#38
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a CKB reserve mechanism across the bot and tester applications to ensure accounts maintain a minimum balance after transactions. It introduces comprehensive secret redaction for sensitive data like private keys and RPC URLs in logs and error summaries. The tester is significantly enhanced with new transaction scenarios (such as SDK conversions and multi-order limit orders) and support for custom fee policies. Feedback suggests optimizing the tester by using local fee estimation instead of RPC calls to improve performance and maintain consistency with the bot's implementation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a CKB reserve mechanism to prevent the bot and tester from exhausting plain CKB needed for transaction fees. It includes logic to estimate post-transaction balances and skip operations that violate the reserve. Additionally, it enhances observability by redacting sensitive data like private keys and RPC URLs from logs and error summaries. The tester application is updated with new scenarios and configurable fee policies. A critical issue was identified in the bot's reserve check: being unconditional, it could cause a deadlock by preventing withdrawals that would otherwise replenish the CKB balance. A conditional check was suggested to ensure the reserve only blocks CKB-consuming transactions.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements CKB reserve management for the bot and tester applications to ensure sufficient funds for operational costs. It introduces various new test scenarios for the tester, enhances security by redacting secrets in logs and error reports, and adds retry mechanisms for transient chain errors. Review feedback highlighted a need to refine the unspent capacity calculation in both applications to strictly count plain CKB cells, ensuring consistency with how output capacities are handled and improving the accuracy of reserve monitoring.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces significant updates to the bot and tester services, primarily focusing on robust CKB reserve management and enhanced observability. Key changes include the implementation of a post-transaction CKB balance check to ensure the bot maintains a defined reserve, the addition of secret redaction for sensitive runtime information in logs and error summaries, and the introduction of new test scenarios for the tester service. Additionally, the transaction building logic has been refactored to support multiple raw orders and SDK-based conversions, and pre-flight chain verification has been added to the startup process.
|
LGTM Phroi %202 |
Why
The live bot and tester need safer bounded execution on testnet so operator runs can fail visibly, preserve CKB reserves, and avoid leaking local secrets in runtime logs.
Changes