Skip to content

rofl-scheduler: Read offer access policy from on-chain metadata#2485

Open
anzoman wants to merge 1 commit into
mainfrom
anzoman/rofl-scheduler-offer-metadata-policy
Open

rofl-scheduler: Read offer access policy from on-chain metadata#2485
anzoman wants to merge 1 commit into
mainfrom
anzoman/rofl-scheduler-offer-metadata-policy

Conversation

@anzoman

@anzoman anzoman commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Moves per-offer allowed_creators and allowed_artifacts from the scheduler's local node config to on-chain offer metadata, so providers can change access policy with a transaction instead of editing the node config and restarting the machine. The scheduler parses an OfferPolicy from each offer's metadata every round (keys allowed_creators, allowed_artifacts.<kind>, and a private listing hint); matching constants are added to the Go SDK for the CLI. The global local-config fields are removed with no fallback.

Implements #2475.

@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for oasisprotocol-oasis-sdk canceled.

Name Link
🔨 Latest commit cc93e2d
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-oasis-sdk/deploys/6a44f294e04df200081d1a20

@anzoman anzoman requested a review from matevz July 1, 2026 10:20
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.66667% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.50%. Comparing base (3e00a16) to head (cc93e2d).

Files with missing lines Patch % Lines
rofl-scheduler/src/manager.rs 52.54% 28 Missing ⚠️
rofl-scheduler/src/config.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2485      +/-   ##
==========================================
+ Coverage   51.29%   51.50%   +0.20%     
==========================================
  Files         237      237              
  Lines       17236    17179      -57     
==========================================
+ Hits         8842     8848       +6     
+ Misses       8334     8271      -63     
  Partials       60       60              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Move the per-offer allowed_creators and allowed_artifacts access policy
out of the scheduler's local node config and into on-chain offer
metadata, so a provider can change it with a transaction instead of
editing the node config and restarting the machine.

The scheduler now reads these well-known offer metadata keys each round:

  - net.oasis.scheduler.offer.allowed_creators: comma-separated creator
    addresses; empty or absent means all creators are allowed.
  - net.oasis.scheduler.offer.allowed_artifacts.<kind>: comma-separated
    allowed artifact hashes per kind; an absent kind allows all.
  - net.oasis.scheduler.offer.private: marks an offer private so it can
    be hidden from normal offer listings. Read but not acted on by the
    scheduler.

The global allowed_creators and allowed_artifacts fields are removed from
the local config (no fallback); RawLocalConfig now ignores unknown fields
so existing configs still load. Matching metadata-key constants are added
to the Go client SDK for use by the CLI.
@anzoman anzoman force-pushed the anzoman/rofl-scheduler-offer-metadata-policy branch from 77aad7b to cc93e2d Compare July 1, 2026 10:57
@anzoman anzoman marked this pull request as ready for review July 1, 2026 11:31

@kostko kostko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This makes sense to me, have you done any tests with an actual scheduler? Before this can be deployed all existing offers need to be updated to use this metadata, right?

@matevz matevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do I remember correctly the current offer is copied over to machine once you deploy your app? And this copied offer is read in the new rofl-scheduler code instead of the latest on-chain offer? So if someone changes offer Metadata afterwards, those won't be reflected in the existing ROFL replica until it's redeployed.


let private = metadata
.get(METADATA_KEY_OFFER_PRIVATE)
.map(|v| is_truthy(v))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

v should be clearly defined by the metadata format and then implemented in CLI accordingly. I'd use "1".

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.

3 participants