fix(#478): replace emitter self-declaration with caller provenance va… - #493
Merged
Oluwaseyi89 merged 1 commit intoAug 3, 2026
Conversation
|
@chinecherem58 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@chinecherem58 please, fix the errors causing the CI failure. |
Contributor
Author
|
@Oluwaseyi89 please boss ejoor |
…rovenance validation
- Add storage.rs module: extracted DataKey enum from lib.rs into its own
module with comprehensive documentation for each storage key.
- Add events.rs module: created PruningEvent (moved from lib.rs) and new
ProvenanceValidationFailed event that captures the actual caller address,
attempted event type, and timestamp when an unauthorized recording attempt
is detected.
- Refactor lib.rs:
- Renamed record_event_auth() → record_event() to reflect the new model
- record_event() now accepts 'caller: Address' instead of the old 'emitter'
- Authorization order: allowlist check first (emits ProvenanceValidationFailed
and panics on failure), then caller.require_auth() to enforce host-level
identity verification via the Soroban auth framework
- emitting_contract is now always the auth-verified caller — the host
guarantees no contract can satisfy require_auth() for a foreign address
- Replaced inline PruningEvent emission with emit_pruning_event() helper
- Imports DataKey from storage module, events from events module
- Update test.rs:
- All existing tests updated to use new record_event(caller, ...) signature
- 5 new provenance/spoofing-prevention tests added:
* test_emitting_contract_reflects_actual_caller
* test_spoofing_unauthorized_address_is_rejected
* test_revoked_emitter_cannot_record_events
* test_two_authorized_callers_produce_independent_records
* test_cannot_record_events_using_another_contracts_identity
All 13 tests pass (8 existing + 5 new).
chinecherem58
force-pushed
the
fix/478-audit-trail-caller-provenance
branch
from
August 3, 2026 09:08
38d113a to
182b15c
Compare
Contributor
Author
|
@Oluwaseyi89 gm gm boss im done fixing all the errors causing the ci check to fail |
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.
…lidation
Add storage.rs module: extracted DataKey enum from lib.rs into its own module with comprehensive documentation for each storage key.
Add events.rs module: created PruningEvent (moved from lib.rs) and new ProvenanceValidationFailed event that captures the actual caller address, attempted event type, and timestamp when an unauthorized recording attempt is detected.
Refactor lib.rs:
Update test.rs:
All 13 tests pass (8 existing + 5 new).
closes #478