Skip to content

rofl: Move offer access policy to on-chain offer metadata - #711

Merged
anzoman merged 4 commits into
masterfrom
anzoman/feature/rofl-offer-access-policy
Aug 25, 2026
Merged

rofl: Move offer access policy to on-chain offer metadata#711
anzoman merged 4 commits into
masterfrom
anzoman/feature/rofl-offer-access-policy

Conversation

@anzoman

@anzoman anzoman commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Adds CLI support for the on-chain ROFL offer access policy introduced in oasisprotocol/oasis-sdk#2485. Implements oasisprotocol/oasis-sdk#2475 (CLI part).

Previously allowed_creators and allowed_artifacts lived in the ROFL node's local config.yml, so changing them meant editing the config and restarting the machine. They are now part of the offer metadata on-chain, and this PR exposes them as first-class fields of the provider manifest:

offers:
  - id: internal_small
    # ...resources, payment and capacity omitted...
    allowed_creators:
      - oasis1qrk58a6j2qn065m6p06jgjyt032f7qucy5wqeqpt
      - oasis1qqnf0s9p8z79zfutszt0hwlh7w7jjrfqnq997mlw
    allowed_artifacts:
      firmware:
        - 4f2b3c1d0e9a8b7c...
    private: true

Applying them is a plain oasis rofl provider update-offers; the scheduler picks the new policy up on the next round.

Docs counterpart for the node config side: oasisprotocol/docs#1788.

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for oasisprotocol-cli canceled.

Name Link
🔨 Latest commit 42784c1
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-cli/deploys/6a8db36ec4d0c700079655be

@anzoman anzoman self-assigned this Aug 5, 2026
@anzoman
anzoman force-pushed the anzoman/feature/rofl-offer-access-policy branch from fb07310 to a2c32dd Compare August 5, 2026 14:09
@anzoman
anzoman requested a review from matevz August 5, 2026 14:12
@anzoman
anzoman marked this pull request as ready for review August 11, 2026 08:09
@rube-de
rube-de requested a review from uniyalabhishek August 19, 2026 09:11

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

Some nits. Otherwise I tested it and works as expected. The internal Testnet provider offer was successfully updated with the private flag and a list of allowed creators: https://explorer.oasis.io/testnet/sapphire/tx/5ccce8efb883667563892ee2eb445f7d80030b5d2c9ef0aec8e2255e0ec3967b

Comment thread cmd/rofl/common/offer.go Outdated
Comment thread cmd/rofl/provider/list.go Outdated
@anzoman
anzoman force-pushed the anzoman/feature/rofl-offer-access-policy branch from b3a4c80 to 4dd9480 Compare August 25, 2026 15:16
Adds the `allowed_creators`, `allowed_artifacts` and `private` offer
fields to the provider manifest. They are stored on-chain as the
`net.oasis.scheduler.offer.*` metadata keys read by the ROFL Scheduler,
so the access policy can now be changed with `rofl provider
update-offers` instead of editing the node config and restarting the
machine.

Account names from the wallet and the address book are resolved to
addresses, artifact kinds and hashes are validated up front and list
entries are sorted and deduplicated so that reordering them in the
manifest does not produce a spurious offer update.
Offers marked as private in their on-chain metadata are now omitted from
`rofl provider list --show-offers`, `rofl provider show` and
`rofl deploy --show-offers`. The new `--all` (`-a`) flag includes them
again and private offers are marked as such when listed.

Automatic offer selection in `rofl deploy` skips private offers, but an
offer explicitly requested via `--offer` is still resolved so that
whitelisted users can rent one.
Documents the `allowed_creators`, `allowed_artifacts` and `private`
offer fields, the `--all` flag of the offer listings and extends the
example provider manifest with an offer reserved for the provider's own
team.
Moves `ShowOfferSummary` from `cmd/rofl/provider` to `cmd/rofl/common`
next to the offer filtering, inlines `PublicOffers` into `FilterOffers`
and renames the file to `provider.go`.

Offer summaries now also list the accounts allowed to rent a machine
from the offer, read from the on-chain metadata via the new
`OfferAllowedCreators` helper.
@anzoman
anzoman force-pushed the anzoman/feature/rofl-offer-access-policy branch from 4dd9480 to 42784c1 Compare August 25, 2026 15:23
@anzoman
anzoman merged commit 4b0fd7e into master Aug 25, 2026
5 checks passed
@anzoman
anzoman deleted the anzoman/feature/rofl-offer-access-policy branch August 25, 2026 15:26
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