Repository navigation
Conversation
The core/guards.rs module implemented a second ReentrancyGuard (ReentrancyGuard::new, enter_guard, exit_guard, with_guard) that was never called from any contract entry point. All real entry points use the non_reentrant! macro from the top-level guards.rs instead. Deleted core/guards.rs and removed its pub mod declaration from core/mod.rs to eliminate the split-brain state where two reentrancy guard implementations coexist with different storage keys. Addresses Vero-protocol#165
Author
|
Closing this to keep the queue tidy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #165
Problem
engine-core/src/core/guards.rsimplemented a second, fully-tested reentrancy guard (ReentrancyGuard,enter_guard,exit_guard,with_guard) that was never called from any contract entry point. Every real entry point uses thenon_reentrant!macro defined in the top-levelengine-core/src/guards.rs.The two implementations used different storage keys (
C_REENTRvsRE_GUARD), creating a split-brain maintenance hazard where a future contributor could reach for the dead guard instead of the active one.Changes
engine-core/src/core/guards.rs(106 lines)pub mod guards;fromengine-core/src/core/mod.rsVerification
rg "core::guards\|core/guards"that no code outside the module itself referencescore::guardsreentrancy_tests.rsfile referencescrate::guards::(the top-level module), notcore::guards::non_reentrant!macro fromguards.rsremains the single, active reentrancy guard implementationImpact
No behavioral change. Dead code removal only.