Skip to content

Conversation

2xburnt
Copy link
Contributor

@2xburnt 2xburnt commented Sep 24, 2025

This pull request introduces significant improvements to the project's developer workflow and test coverage. The most important changes are the addition of comprehensive unit tests for the ante and post handler constructors, a major overhaul of the README.md to better document the Makefile targets and development process, and minor dependency import updates. These changes collectively enhance reliability, maintainability, and ease of onboarding for new contributors.

Testing improvements:

  • Added exhaustive unit tests in app/ante_test.go to validate error handling and coverage for NewAnteHandler and NewPostHandler, ensuring all configuration errors are caught and all code paths are exercised for 100% coverage.

Documentation and developer workflow:

  • Revamped the README.md to provide detailed documentation of Makefile targets, modular organization, prerequisites, and example workflows, making it easier for developers to understand and use the build and test system.
  • Updated the pre-commit hook in .husky/hooks/pre-commit to use make test-cover for consistency with the new Makefile-based workflow.

Dependency management:

  • Added missing imports in app/app_test.go to support new testing and API features, improving test reliability and code clarity.

2xburnt and others added 8 commits September 23, 2025 15:19
- Add MaxWebAuthDataSize constant (64KB) to prevent oversized payloads
- Add ErrWebAuthDataTooLarge error type for size validation failures
- Implement size validation in WebAuthNVerifyRegister and WebAuthNVerifyAuthenticate endpoints
- Add comprehensive tests for size limit validation
- Mitigates DoS vulnerability where attackers could send large CBOR payloads causing linear CPU/memory usage
Fixes vulnerability where gas was charged before calling GetAllowance(),
allowing attackers to force validators to consume excessive gas for
minimal fees by crafting transactions with many failing allowances.

Changes:
- Move gas consumption to after successful GetAllowance() calls
- Add comprehensive tests demonstrating vulnerability and fix
- Preserve existing functionality for legitimate use cases

Security Impact:
- Eliminates DoS vector via economic gas/fee mismatch
- Ensures fair gas accounting for failed operations
- Prevents validators from working beyond intended parameters

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This test addresses security report #52897 by verifying that MsgSetPlatformMinimum
can be submitted as a direct CLI transaction and properly processed by the network.

The test includes three comprehensive scenarios:
1. DirectCLITransaction: Validates message creation, serialization, and sdk.Msg interface
2. TransactionPipelineIntegration: Tests full transaction pipeline via governance
3. MessageBroadcastingAndProcessing: Verifies network compatibility and processing

This ensures the message works correctly in production transaction flows,
confirming the vulnerability has been resolved.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@2xburnt 2xburnt merged commit 3e897d2 into release/v22 Sep 29, 2025
61 of 62 checks passed
@2xburnt 2xburnt deleted the chore/release-v22-tests branch September 29, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant