Skip to content

Strict reentrancy protection#65

Merged
N-thnI merged 3 commits into
Vero-protocol:mainfrom
gloskull:strict-reentrancy-protection
Jun 26, 2026
Merged

Strict reentrancy protection#65
N-thnI merged 3 commits into
Vero-protocol:mainfrom
gloskull:strict-reentrancy-protection

Conversation

@gloskull

Copy link
Copy Markdown
Contributor

Implement strict reentrancy protection in the engine-core smart contracts. The solution uses a state lock in Soroban's temporary storage, managed by a ReentrancyGuard struct and a non_reentrant! macro.

Key changes:

Created engine-core/src/guards.rs with the guard logic and macro.
Applied reentrancy guards to critical entry points.
Refactored error enums to #[contracterror].
Fixed existing bugs in the test suite and contract logic that prevented compilation and test execution.
Added comprehensive tests for governance and reentrancy.
Closes gloskull#2

google-labs-jules Bot and others added 2 commits June 19, 2026 15:02
- Implemented reentrancy guard using Soroban's temporary storage and RAII pattern.
- Added `non_reentrant!` macro and applied it to state-mutating functions in `audit.rs`, `governance.rs`, and `circuit_breaker.rs`.
- Upgraded error enums from `#[contracttype]` to `#[contracterror]` for correct `panic_with_error!` behavior.
- Fixed `governance_tests.rs`: restored imports, implemented test logic, and provided contract context.
- Resolved type mismatches and doc test issues in `governance.rs`.
- Added `reentrancy_tests.rs` to verify the guard functionality.
- Verified all 15 tests in `engine-core` pass.

Co-authored-by: gloskull <189399494+gloskull@users.noreply.github.com>
…9159307060885706559

Implement Strict Reentrancy Protection
@N-thnI

N-thnI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

please resolve conflicts and it will be ready for merge

@gloskull

Copy link
Copy Markdown
Contributor Author

Conflicts have been resolved.

@N-thnI N-thnI merged commit 56a5ed3 into Vero-protocol:main Jun 26, 2026
@N-thnI

N-thnI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Good job

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.

2 participants