Skip to content

Implement rent-pending ATA materialization#1381

Open
GabrielePicco wants to merge 16 commits into
masterfrom
feature/rent-pending-ata-materialization
Open

Implement rent-pending ATA materialization#1381
GabrielePicco wants to merge 16 commits into
masterfrom
feature/rent-pending-ata-materialization

Conversation

@GabrielePicco

@GabrielePicco GabrielePicco commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add rent-pending ATA detection using the rent sysvar close-authority sentinel and validate newly created accounts finish execution with a positive token balance
  • record materialization metadata during scheduling, charge the delegated payer, and prepend e-token initialize/delegate tasks before DLP commit work
  • add coverage for scheduling metadata, payer charge, rollback, committor task ordering, and the delegated-elsewhere conflict path
  • update the validator specification and crate notes for the new flow

Summary by CodeRabbit

  • New Features

    • Added rent-pending canonical ATA/ephemeral ATA support via the CreateRentPendingAta instruction, including automatic scheduling metadata and eATA materialization during commit flows.
    • Enhanced commit/finalize execution with validator-aware rent-pending nonce/fee handling and rent-pending reimbursement logic.
  • Bug Fixes

    • Rejects rent-pending ATA creations that end with zero token balance, with rollback enforced.
    • Adds stricter failure gating for existing eATA delegate/validator mismatches before DLP commit/undelegate steps.
  • Documentation

    • Expanded protocol specs and guides covering rent-pending ATA rules, fees, compatibility, and failure semantics.
  • Tests

    • Added coverage for rent-pending ATA creation rollback, fee/nonce behavior, and mismatch gating.

@coderabbitai

This comment was marked as outdated.

@GabrielePicco GabrielePicco marked this pull request as ready for review July 3, 2026 09:22
@GabrielePicco GabrielePicco requested review from bmuddha and snawaz July 3, 2026 09:23
chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

- Fetch real commit nonces for rent-pending eATAs, defaulting missing
  delegation metadata to nonce 0 only for allowed pubkeys, so repeat
  commits use the on-chain nonce instead of a hardcoded 1
- Default rent reimbursement to the materialization validator for
  rent-pending eATAs so commit-and-undelegate no longer aborts on the
  not-yet-created delegation-metadata PDA
- Initialize Token-2022 rent-pending ATAs via unpack_uninitialized with
  required account extensions and account-type byte
- Add legacy bincode fallback for MagicContext so pending intents
  persisted by the previous binary still deserialize
- Derive rent-pending materializations from committed eATA rows on
  committor recovery: prepend init/delegate only when the base
  delegation-metadata PDA is actually missing, and default undelegate
  rent reimbursement to the validator for derived entries, making the
  flow restart-recoverable without persisting metadata
- Reject default wallet owner/mint in rent-pending detection and
  creation: default pubkeys are reserved as the MagicContext
  legacy-decode sentinel and must never be written as materializations
- Reuse the pre-construction fee-vault decision in
  process_schedule_intent_bundle so undelegating the payer mid-bundle
  cannot skip the fee charge
- Add regression tests: rent-pending commit without fee vault is
  rejected, detection negative gates, default owner/mint rejection
- Clarify missing-metadata nonce semantics in the fetcher docs
@GabrielePicco GabrielePicco force-pushed the feature/rent-pending-ata-materialization branch from 93118f2 to ec351fb Compare July 3, 2026 15:51
chatgpt-codex-connector[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a80d96fa2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread magicblock-committor-service/src/tasks/task_builder.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ab55195d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 813ebc4074

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread magicblock-core/src/token_programs.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c217614ded

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread magicblock-processor/src/executor/processing.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 887ce08aa5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread magicblock-committor-service/src/tasks/mod.rs
@GabrielePicco GabrielePicco requested a review from taco-paco July 8, 2026 09:53
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.

1 participant