Skip to content

Commit d601911

Browse files
authored
refactor: sandbox to runtime (#2729)
* refactor: sandbox to runtime * refactor: simpler e2e runtime tests style (#2737) * refactor: simpler e2e runtime tests style * fix: fmt & external error change * refactor: remove left over sandbox usage * refactor: simplify e2e node tests (#2738) * refactor: simpler e2e runtime tests style * fix: fmt & external error change * refactor: remove left over sandbox usage * refactor: simplify e2e node tests * fmt * refactor: import simplification * fix: use full import
1 parent 000aecf commit d601911

File tree

82 files changed

+780
-844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+780
-844
lines changed

ARCHITECTURE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ ink! contracts are compiled to RISC-V bytecode for
6060
This is how ink! smart contracts are executed on a blockchain:
6161
they are uploaded to a blockchain that runs PolkaVM, PolkaVM then
6262
interprets them.
63-
As contracts are executed in a sandbox execution environment on the
64-
blockchain itself we compile them to a `no_std` environment.
63+
As contracts are executed in the runtime environment on the
64+
blockchain we compile them to a `no_std` environment.
6565
More specifically they are executed by the [`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive),
6666
a module of the Polkadot SDK blockchain framework. This module takes ink!
67-
smart contracts and runs them in a PolkaVM sandbox environment.
67+
smart contracts and runs them in a PolkaVM execution environment.
6868
It also provides an API to smart contracts for anything a smart contract
6969
needs: storing + retrieving data, calling other contracts, sending value,
7070
fetching the block number, ….
@@ -250,9 +250,9 @@ most smart-contract-specific events: `Called`, `ContractCodeUpdated, CodeStored`
250250
The `Instantiated` event was brought back in a later PR.
251251

252252
(5) `pallet-revive` included `revm` as a non-optional dependency. As ink! has to
253-
depend on `pallet-revive` for some features (e.g. sandboxed E2E testing), this
253+
depend on `pallet-revive` for some features (e.g. runtime E2E testing), this
254254
results in over 75 more child dependencies having to be build now. This increased
255-
build times for sandboxed E2E tests significantly.
255+
build times for runtime E2E tests significantly.
256256
[We proposed](https://github.com/paritytech/polkadot-sdk/pull/9689) putting anything
257257
`revm` behind a feature flag, but Parity is not open to it.
258258

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
[Unreleased]
88

9-
## Added
9+
### Added
1010
- Implements the API for the `pallet-revive` host functions `chain_id`, `balance_of`, `base_fee`, `origin`, `code_size`, `block_hash`, `block_author` - [#2719](https://github.com/use-ink/ink/pull/2719)
1111
- Implement `From<ink::Address>` for "ink-as-dependency" contract refs - [#2728](https://github.com/use-ink/ink/pull/2728)
1212

13+
### Changed
14+
- Rename `ink_sandbox` crate to `ink_runtime`, `Sandbox` trait to `RuntimeEnv`, and `SandboxClient` to `RuntimeClient` for improved clarity. Also simplifies syntax for e2e tests, both runtime and node e2e tests.
15+
1316
## Version 6.0.0-beta.1
1417

1518
### Added

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ members = [
1515
"crates/revive-types",
1616
"crates/prelude",
1717
"crates/primitives",
18-
"crates/sandbox",
18+
"crates/runtime",
1919
"crates/storage",
2020
"crates/storage/traits"
2121
]
@@ -81,7 +81,7 @@ tracing-subscriber = { version = "0.3.20" }
8181
trybuild = { version = "1.0.110" }
8282
which = { version = "8.0.0" }
8383
xxhash-rust = { version = "0.8" }
84-
const_env = { version = "0.1" }
84+
const_env = { version = "0.1.4" }
8585
const-hex = { version = "1.17.0", default-features = false }
8686

8787
# Substrate dependencies

RELEASES_CHECKLIST.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ in the future.
6060
- Release `cargo-contract` crates.
6161
- Request update of `drink` client, which depends on the `cargo-contract` crates.
6262
- Release `ink_e2e`.
63-
1. The `ink_sandbox` crate depends on a git commit of `polkadot-sdk`, hence it
63+
1. The `ink_runtime` crate depends on a git commit of `polkadot-sdk`, hence it
6464
currently cannot be published to crates.io.
6565
1. Do a dry run:
6666
```bash
6767
fd Cargo.toml crates/ | \
6868
grep -v e2e | \
69-
grep -v sandbox | \
69+
grep -v runtime/ | \
7070
xargs -n1 cargo no-dev-deps publish --allow-dirty --dry-run --manifest-path
7171
```
72-
This command ignores the `e2e` and `sandbox` folder: The `e2e` crates depend on the `cargo-contract/contract-build`
72+
This command ignores the `e2e` and `runtime` folders: The `e2e` crates depend on the `cargo-contract/contract-build`
7373
crate, so if you want to publish those, you need to publish `cargo-contract/contract-build` first.
74-
The `sandbox` is ignored, as it depends on some crates via their `git` ref.
74+
The `runtime` is ignored, as it depends on some crates via their `git` ref.
7575
It uses [`no-dev-deps`](https://crates.io/crates/cargo-no-dev-deps)
7676
for publishing, so that the `dev-dependencies` of ink! are ignored for publishing.
7777
They are not needed and due to a cycle it's also not possible to publish with them.

crates/e2e/macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tracing = { workspace = true }
3131
[dev-dependencies]
3232
ink = { path = "../../ink" }
3333
ink_e2e = { path = "../" }
34-
ink_sandbox = { path = "../../sandbox" }
34+
ink_runtime = { path = "../../runtime" }
3535
temp-env = "0.3.6"
3636

3737
[features]

0 commit comments

Comments
 (0)