Skip to content

Addressable entity as a default. - #657

Open
kubaplas wants to merge 8 commits into
release/3.0.0from
feature/addressable-entity
Open

kubaplas wants to merge 8 commits into
release/3.0.0from
feature/addressable-entity

Conversation

@kubaplas

Copy link
Copy Markdown
Contributor

Plus migration tooling and tests.

@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.611152757 CSPR (0.23%)
Contract Call Entry point: set_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_variable 🔴 +0.003353516 CSPR (0.66%)
Contract Call Entry point: set_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: set_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: push_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: init_submodule 🔴 +0.000006265 CSPR (0.00%)
Contract Call Entry point: call_submodule 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: call_payable 🔴 +0.006706522 CSPR (0.11%)
Contract Call Entry point: transfer_back 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: emit_event 🔴 +0.00000351 CSPR (0.00%)
Contract Call Entry point: set_named_key 🔴 +0.003353761 CSPR (1.74%)
Contract Call Entry point: get_named_key 🔴 +0.000001755 CSPR (0.00%)
Contract Call Entry point: set_dictionary 🔴 +0.003353761 CSPR (1.18%)
Contract Call Entry point: get_dictionary 🔴 +0.000000755 CSPR (0.00%)

1 similar comment
@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.611152757 CSPR (0.23%)
Contract Call Entry point: set_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_variable 🔴 +0.003353516 CSPR (0.66%)
Contract Call Entry point: set_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: set_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: push_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: init_submodule 🔴 +0.000006265 CSPR (0.00%)
Contract Call Entry point: call_submodule 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: call_payable 🔴 +0.006706522 CSPR (0.11%)
Contract Call Entry point: transfer_back 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: emit_event 🔴 +0.00000351 CSPR (0.00%)
Contract Call Entry point: set_named_key 🔴 +0.003353761 CSPR (1.74%)
Contract Call Entry point: get_named_key 🔴 +0.000001755 CSPR (0.00%)
Contract Call Entry point: set_dictionary 🔴 +0.003353761 CSPR (1.18%)
Contract Call Entry point: get_dictionary 🔴 +0.000000755 CSPR (0.00%)

@kubaplas
kubaplas force-pushed the feature/addressable-entity branch from 85994d1 to 4fc5202 Compare August 10, 2026 12:23
@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.611152757 CSPR (0.23%)
Contract Call Entry point: set_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_variable 🔴 +0.003353516 CSPR (0.66%)
Contract Call Entry point: set_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: set_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: push_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: init_submodule 🔴 +0.000006265 CSPR (0.00%)
Contract Call Entry point: call_submodule 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: call_payable 🔴 +0.006706522 CSPR (0.11%)
Contract Call Entry point: transfer_back 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: emit_event 🔴 +0.00000351 CSPR (0.00%)
Contract Call Entry point: set_named_key 🔴 +0.003353761 CSPR (1.74%)
Contract Call Entry point: get_named_key 🔴 +0.000001755 CSPR (0.00%)
Contract Call Entry point: set_dictionary 🔴 +0.003353761 CSPR (1.18%)
Contract Call Entry point: get_dictionary 🔴 +0.000000755 CSPR (0.00%)

@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.5988593 CSPR (0.22%)
Contract Call Entry point: set_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_variable 🔴 +0.003353516 CSPR (0.66%)
Contract Call Entry point: set_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: set_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: push_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: init_submodule 🔴 +0.000006265 CSPR (0.00%)
Contract Call Entry point: call_submodule 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: call_payable 🔴 +0.006706522 CSPR (0.11%)
Contract Call Entry point: transfer_back 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: emit_event 🔴 +0.00000351 CSPR (0.00%)
Contract Call Entry point: set_named_key 🔴 +0.003353761 CSPR (1.74%)
Contract Call Entry point: get_named_key 🔴 +0.000001755 CSPR (0.00%)
Contract Call Entry point: set_dictionary 🔴 +0.003353761 CSPR (1.18%)
Contract Call Entry point: get_dictionary 🔴 +0.000000755 CSPR (0.00%)

@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.5988593 CSPR (0.22%)
Contract Call Entry point: set_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_variable 🔴 +0.003353516 CSPR (0.66%)
Contract Call Entry point: set_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: set_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: push_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: init_submodule 🔴 +0.000006265 CSPR (0.00%)
Contract Call Entry point: call_submodule 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: call_payable 🔴 +0.006706522 CSPR (0.11%)
Contract Call Entry point: transfer_back 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: emit_event 🔴 +0.00000351 CSPR (0.00%)
Contract Call Entry point: set_named_key 🔴 +0.003353761 CSPR (1.74%)
Contract Call Entry point: get_named_key 🔴 +0.000001755 CSPR (0.00%)
Contract Call Entry point: set_dictionary 🔴 +0.003353761 CSPR (1.18%)
Contract Call Entry point: get_dictionary 🔴 +0.000000755 CSPR (0.00%)

kubaplas and others added 2 commits September 14, 2026 13:03
casper-client: published 5.0.1 (2026-03-16) requires casper-types ^7.0.0, so
the update-casper-types-to-7 branch is no longer needed. The API it was pinned
for is present in the release - the workspace compiles and the full test suite
passes against it.

casper-contract-schema: published as 0.7.0, so its [patch] line is removed and
it resolves from crates.io. The workspace requirement moves 0.6.0 -> 0.7.0 in
step; without that the patch would have silently dropped out of the graph.

The remaining five casper-node crates stay patched. Re-checked against
crates.io on 2026-09-14: casper-engine-test-support is still 8.1.1 and
casper-contract still 5.1.1 (both requiring casper-types ^6), unchanged for
14 months. casper-event-standard stays patched too - it needs casper-contract
on wasm32, so publishing it against casper-types 7 would give consumers two
incompatible casper-types at once.

Also records the failure mode found while doing this: when a patched crate's
version stops satisfying the requirement, cargo only warns and silently uses
the crates.io copy instead, pulling in a duplicate casper-types.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`upgrade_contract` forced the lazy package migration and only then looked up
the version to disable. The legacy package record is readable right up until
the migration converts it, and no wasm API can read a migrated package, so
that ordering threw away the one moment the authoritative value is available
and left the account named key as the only source.

Reading first prefers the package record itself and falls back to the named
key for packages already migrated or installed in addressable-entity mode.

This does NOT by itself let a contract installed before Odra 3.0.0 be upgraded
after the switch. Such a package has no `odra_noop` entry point, so the forced
migration reverts; migrating it out-of-band first avoids that, but then the
legacy record is already gone and there is no named key to fall back to. A
fix needs a way to migrate without `odra_noop` - e.g. an optional upgrade
argument naming a safe entry point to call instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Benchmark report

Action Details Gas diff
Wasm Deploy Filename: Benchmark.wasm 🔴 +0.5988719 CSPR (0.22%)
Contract Call Entry point: set_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_variable 🔴 +0.003353516 CSPR (0.66%)
Contract Call Entry point: set_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_struct_variable 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: set_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_mapping 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: push_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: get_list 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: init_submodule 🔴 +0.000006265 CSPR (0.00%)
Contract Call Entry point: call_submodule 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: call_payable 🔴 +0.006706522 CSPR (0.11%)
Contract Call Entry point: transfer_back 🔴 +0.000000755 CSPR (0.00%)
Contract Call Entry point: emit_event 🔴 +0.00000351 CSPR (0.00%)
Contract Call Entry point: set_named_key 🔴 +0.003353761 CSPR (1.74%)
Contract Call Entry point: get_named_key 🔴 +0.000001755 CSPR (0.00%)
Contract Call Entry point: set_dictionary 🔴 +0.003353761 CSPR (1.18%)
Contract Call Entry point: get_dictionary 🔴 +0.000000755 CSPR (0.00%)

@kubaplas kubaplas mentioned this pull request Oct 6, 2026
@kubaplas

Copy link
Copy Markdown
Contributor Author

Follow-ups for this PR, collected from a review of the branch (state as of 2026-10-13):

Base

Dependencies

  • Still blocked for crates.io: casper-engine-test-support is at 8.1.1 there (9 needed) and casper-contract at 5.1.1 (casper-types 6). Until they're published:
    • pin casper-event-standard to a rev instead of the feature/casper-types-7 branch (Cargo.lock is gitignored, so a push upstream silently changes the build);
    • keep a single copy of the [patch] block (it's duplicated in odra-casper/proxy-caller/Cargo.toml);
    • open a PR for the types-7 change in casper-event-standard upstream.

Upgrades across the AE switch

  • Contracts deployed with Odra 2.x don't export odra_noop, so force_package_migration_if_needed reverts (NoSuchMethod) when upgrading them after the switch. Allow a fallback entry point (e.g. an upgrade argument naming one), add odra_noop to the generated schema, and mark it "remove once casper-node fixes add_contract_version".
  • odra_latest_version_<package> is stored in the installing account's named keys, so another member of the upgrader group can't upgrade; get_latest_contract_hash / get_latest_contract_version have no fallback on migrated packages.

Tests

  • The AE migration tests (modules/src/cep18/tests/ae_migration.rs, examples/src/features/upgrade.rs::upgrade_across_ae_switch) return early unless ODRA_CASPER_LEGACY_GENESIS=1, which CI never sets, so they pass without testing anything. Add a CI job/recipe with it, or make them fail loudly.

API

  • Decide what Address::try_from(Key) does with Key::Package, Key::AddressableEntity and Key::SmartContract (core/src/address.rs): convert to the package/account address or reject explicitly, and document it.
  • caller_info_to_caller in odra-casper/wasm-env/src/host_functions.rs uses .expect(); revert with CannotExtractCallerInfo like the other branches.

Docs

  • Update migrations/to-3.0.0.md after the rebase (2.10 changed a lot of the surrounding API).

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