Skip to content

Fix/harden input validation human readable identifiers#650

Merged
Jagadeeshftw merged 7 commits intoJagadeeshftw:masterfrom
Obiajulu-gif:fix/harden-input-validation-human-readable-identifiers
Feb 26, 2026
Merged

Fix/harden input validation human readable identifiers#650
Jagadeeshftw merged 7 commits intoJagadeeshftw:masterfrom
Obiajulu-gif:fix/harden-input-validation-human-readable-identifiers

Conversation

@Obiajulu-gif
Copy link
Contributor

This pull request introduces several important improvements across the contracts and their tests, focusing on enhanced configuration management, input validation, and pause/emergency functionality. The changes add robust snapshot and rollback documentation, stricter input validation in program metadata, and new pause/emergency withdrawal tests for contract safety. Additionally, the multisig configuration is improved for easier state management and debugging.

Configuration Management & Recovery:

  • Added CONFIGURATION_SNAPSHOTS_ROLLBACK.md documentation detailing on-chain configuration snapshot and rollback capabilities for program-escrow and grainlify-core, including retention, workflow, contract methods, and admin-only authorization.
  • Introduced methods in grainlify-core/src/multisig.rs for getting, setting, and clearing multisig config, supporting controlled restore operations and improving contract state management.

Input Validation:

  • Added comprehensive input validation tests for program IDs and metadata in program-escrow/src/test_metadata_tagging.rs, ensuring proper error handling for empty, overly long IDs, and invalid metadata tags.

Pause & Emergency Functionality:

  • Added tests to bounty_escrow/contracts/escrow/src/test_bounty_escrow.rs for pause/unpause functionality and emergency withdrawal, ensuring contract safety and correct pause state behavior.

Code Quality & Debugging:

  • Enhanced MultiSigConfig struct in grainlify-core/src/multisig.rs with Debug, Eq, and PartialEq traits for easier debugging and test assertions.

Subproject Update:

  • Updated grainlify subproject to commit c1d13d606bff2190e9c64090d6d6bd6c780278f3.

Closes #608

- Add validation module with length and character restrictions
- Validate program IDs, names, types, tags, and metadata fields
- Prevent control characters and extremely long strings
- Apply consistent validation across program and bounty escrow contracts
- Add comprehensive tests for valid and invalid inputs

Closes Jagadeeshftw#608
@vercel
Copy link

vercel bot commented Feb 25, 2026

@Obiajulu-gif is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

Obiajulu-gif and others added 3 commits February 25, 2026 18:56
- Replace std::panic::catch_unwind with #[should_panic] attributes
- Use proper Soroban testing patterns for validation tests
- Fix function call to use get_program_info instead of non-existent get_program_data

This should resolve CI compilation issues with no_std environment.
- Add consistent input validation for bounty types and metadata
- Prepare for future EscrowMetadata validation
- Maintain consistency across all contracts
@Jagadeeshftw
Copy link
Owner

please resolve the conflicts

@Obiajulu-gif
Copy link
Contributor Author

@Jagadeeshftw I have resolved it

@Jagadeeshftw
Copy link
Owner

please resolve the conflicts

@Obiajulu-gif
Copy link
Contributor Author

@Jagadeeshftw merge my code

@Jagadeeshftw Jagadeeshftw merged commit 11f7f4f into Jagadeeshftw:master Feb 26, 2026
1 of 4 checks passed
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.

Harden Input Validation for Human-Readable Identifiers

2 participants