GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(id): program transfer contract + source export/fence (#3901, port of #3931) by dezren39 · Pull Request #8375 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Salvage note — PR #3931 vs this canonical PR (task 8542)Per the duplicate-PR protocol: PR #3931 is the original implementation of issue #3901 and this PR is its port. The comparison is by construction, not file lists: this branch is PR #3931's only commit (323f43f) cherry-picked onto current main, so everything in PR #3931 is here except where a conflict forced a merge with newer main code. The three conflict resolutions are listed in this PR's body; in each case the resolution keeps BOTH sides (the #2814 BindAuthorKey command and signed-input gate, and main's #2818 Verdict: nothing unique remains in PR #3931. It is being closed as superseded by this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: c8ab72c76f
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| validate_entity_ref(entity_ref)?; | ||
| let participant_id = self.authorize(token, WorldScopes::INPUT)?; | ||
| self.ensure_uses_left(participant_id)?; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preserve the bound-author check for entity input
For a participant that has called bind_author_key, this new path accepts unsigned actions using only the capability token. Unlike prepare_input, it never checks author_keys, and WorldHandle::entity_input provides no signature to verify. Both native and sandbox programs deliver these entity-input bytes to their normal update handlers, so callers can execute actions without the bound player's signature or corresponding signed-move evidence. Refuse entity input for bound-author participants until signed entity input is supported.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in de9299b. prepare_entity_input now refuses a participant with a bound author key ("participant … has a bound author key; inputs must be player-signed (#2814)"), matching the guarantee the non-entity input path already enforced. Regression test: bound_author_participant_cannot_use_unsigned_entity_input. World suite: 147/147 pass; cargo check -p id clean.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ensure!( | ||
| !self.limits.region_sharded, | ||
| "region-sharded worlds require entity-addressed input" | ||
| ); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Apply the region-sharded gate to signed inputs too
In a region-sharded world, a bound participant can bypass this requirement through input_signed: the actor dispatches signed requests directly to prepare_input_signed, which still constructs an unscoped WorldEventKind::Input without checking region_sharded or entity fences. Consequently, signed application inputs remain executable after an entity export even though the new source fence is supposed to prevent further entity writes. Apply the entity-addressing requirement to the signed preparation path as well.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in de9299b. The signed-input path now applies the same region-sharded gate as the entity path: in a region-sharded world it refuses unscoped signed input with "region-sharded worlds require entity-addressed input", before uses/input-size checks run the program path. Regression test: region_sharded_world_rejects_signed_unscoped_input. World suite: 147/147 pass; cargo check -p id clean.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } => { | ||
| let result = match self.core.prepare_entity_input(&token, &entity_ref, &input) { | ||
| Ok(_) if self.storage_failed => Err(anyhow::anyhow!( | ||
| "world storage failed; the world is read-only" | ||
| )), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reject replica entity inputs before updating the program
On a read-only replica, an entity-input request with a valid input capability reaches program.update before persist rejects the write. The program is therefore mutated despite the error response, leaving its state divergent from the verified journal while program_healthy remains true. The existing Input command avoids this by calling check_writable before touching the program; add the same early guard to this command.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in de9299b. The actor's entity-input handler now calls check_writable() and replies with that error before prepare_entity_input can touch the program instance, so a read-only replica never runs entity inputs through its program. Regression test: entity_input_on_a_read_only_replica_never_reaches_the_program. World suite: 147/147 pass; cargo check -p id clean.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| !self.handoff_transfers.iter().any(|existing| { | ||
| existing.handoff_id == transfer.handoff_id | ||
| || (existing.direction == HandoffDirection::Export | ||
| && existing.entity_ref == transfer.entity_ref) | ||
| }), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Return the stored export receipt on an exact retry
If an export commits but its reply is lost, or the actor restarts after a post-append application failure, retrying the same handoff can never recover its receipt: export_entity reruns the preparation hook and this check then rejects the already-recorded handoff. The entity remains fenced, and repository-wide searches for export_entity, handoff_transfers, and HandoffTransferState reveal no alternative receipt-query command on WorldHandle. This prevents the replay-and-return recovery required by the handoff design. Before preparing another export, recognize an exact retry and return its stored receipt once application/replay has succeeded, while continuing to reject conflicting requests.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in de9299b. The export path first looks for a stored export handoff with the same handoff id; when every request field matches (entity, regions, prior owner epoch, program module hash), it returns the stored receipt instead of preparing a duplicate the core would refuse. A stored export whose fields differ is not treated as a retry — it falls through to validate_entity_export, which rejects the conflict. Regression test: export_exact_retry_returns_the_stored_receipt. World suite: 147/147 pass; cargo check -p id clean.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Four P1 findings on PR #8375, one fix each: (1) entity input now refuses participants with a bound author key, who must player-sign (#2814); (2) the region-sharded entity-addressed gate also applies to signed unscoped input; (3) the actor refuses entity input on a read-only replica before prepare touches the program; (4) an exact export retry returns the stored handoff receipt instead of preparing a duplicate the core would refuse. Each fix carries a regression test: world suite 147/147 pass, cargo check -p id clean.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
id: implement #3870 phase 2 — program transfer contract + source export/fence
There was an error while loading. Please reload this page.