-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
infra: sync with main from gl tezos kernel repo on commit d4585026
- Loading branch information
Showing
219 changed files
with
62,143 additions
and
11,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
target/ | ||
_build | ||
preimage | ||
|
||
stripped_debug_kernel.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
run_everything: | ||
image: nixos/nix | ||
workflow: | ||
rules: | ||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' | ||
|
||
stages: | ||
- test | ||
- build | ||
|
||
cargo-test: | ||
stage: test | ||
image: rust | ||
script: | ||
- rustup component add clippy rustfmt | ||
- cargo fmt --check | ||
- cargo clippy -- -D warnings | ||
- cargo test | ||
|
||
cargo-build: | ||
stage: build | ||
image: rust | ||
variables: | ||
TZWITTER_L1_CONTRACT: "KT1..." | ||
script: | ||
- nix develop --experimental-features "nix-command flakes" --extra-substituters https://tezos.nix-cache.workers.dev --extra-trusted-public-keys tezos-nix-cache.marigold.dev-1:4nS7FPPQPKJIaNQcbwzN6m7kylv16UCWWgjeZZr2wXA= --command cargo make ci | ||
- cargo build --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2022 Marigold <[email protected]> | ||
# SPDX-FileCopyrightText: 2022 Nomadic Labs <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
[package] | ||
name = "debug-kernel" | ||
version = "0.1.0" | ||
|
@@ -7,4 +12,4 @@ edition = "2021" | |
crate-type = ["cdylib", "lib"] | ||
|
||
[dependencies] | ||
tezos-smart-rollup = "0.1.0" | ||
tezos-smart-rollup = "0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load inputs | ||
step result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
// SPDX-FileCopyrightText: 2022 Marigold <[email protected]> | ||
// SPDX-FileCopyrightText: 2022 Nomadic Labs <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
extern crate alloc; | ||
|
||
use tezos_smart_rollup::{kernel_entry, prelude::*}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Nomadic Labs <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
[package] | ||
name = "storage-kernel" | ||
version = "0.1.0" | ||
|
@@ -7,4 +12,4 @@ edition = "2021" | |
crate-type = ["cdylib", "lib"] | ||
|
||
[dependencies] | ||
tezos-smart-rollup = {version = "0.1.0", features = ["testing"]} | ||
tezos-smart-rollup = {version = "0.2.0", features = ["testing"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
load inputs | ||
step result | ||
show key /greeting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
// SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
// SPDX-FileCopyrightText: 2023 Nomadic Labs <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
extern crate alloc; | ||
|
||
use tezos_smart_rollup::{kernel_entry, prelude::*, storage::path::OwnedPath}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Nomadic Labs <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
[package] | ||
name = "reboot-kernel" | ||
version = "0.1.0" | ||
|
@@ -7,4 +12,4 @@ edition = "2021" | |
crate-type = ["cdylib", "lib"] | ||
|
||
[dependencies] | ||
tezos-smart-rollup = "0.1.0" | ||
tezos-smart-rollup = "0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
load inputs | ||
step result | ||
step result | ||
step result | ||
step result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
use tezos_smart_rollup::{kernel_entry, prelude::*, storage::path::OwnedPath}; | ||
|
||
/// In this example, we'll begin to explore the control | ||
|
@@ -24,7 +28,7 @@ use tezos_smart_rollup::{kernel_entry, prelude::*, storage::path::OwnedPath}; | |
/// a single call to the entry function; instead, mark | ||
/// it for reboot, exit, and process the remaining inputs | ||
/// in the next call. | ||
fn entry(host: &mut impl Runtime) { | ||
pub fn entry(host: &mut impl Runtime) { | ||
debug_msg!(host, "Hello from kernel!\n"); | ||
let greeting_path: OwnedPath = "/greeting".as_bytes().to_vec().try_into().unwrap(); | ||
let _ = Runtime::store_write(host, &greeting_path, "hello world".as_bytes(), 0); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Nomadic Labs <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
[package] | ||
name = "inbox-kernel" | ||
version = "0.1.0" | ||
|
@@ -7,4 +12,4 @@ edition = "2021" | |
crate-type = ["cdylib", "lib"] | ||
|
||
[dependencies] | ||
tezos-smart-rollup = "0.1.0" | ||
tezos-smart-rollup = "0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load inputs | ||
step result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
// SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
// SPDX-FileCopyrightText: 2023 Nomadic Labs <[email protected]> | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
use tezos_smart_rollup::{ | ||
inbox::{InboxMessage, InternalInboxMessage}, | ||
kernel_entry, | ||
|
@@ -39,7 +44,7 @@ fn read_inbox_message<Expr: Michelson>(host: &mut impl Runtime) { | |
match InboxMessage::<Expr>::parse(message.as_ref()) { | ||
Ok(parsed_msg) => match parsed_msg { | ||
(remaining, InboxMessage::Internal(msg)) => { | ||
assert!(remaining.is_empty()); | ||
debug_assert!(remaining.is_empty()); | ||
match msg { | ||
InternalInboxMessage::StartOfLevel => { | ||
// The "Start of level" message is pushed by the Layer 1 | ||
|
@@ -78,8 +83,8 @@ fn read_inbox_message<Expr: Michelson>(host: &mut impl Runtime) { | |
// For a simple practical example, see `counter-kernel`, where | ||
// external messages are used to encode the state transitions | ||
// of a counter. | ||
assert!(remaining.is_empty()); | ||
let message = String::from_utf8_lossy(&msg); | ||
debug_assert!(remaining.is_empty()); | ||
let message = String::from_utf8_lossy(msg); | ||
debug_msg!(host, "External message: \"{}\"\n", message); | ||
} | ||
}, | ||
|
@@ -107,7 +112,7 @@ fn read_inbox_message<Expr: Michelson>(host: &mut impl Runtime) { | |
} | ||
} | ||
|
||
fn entry(host: &mut impl Runtime) { | ||
pub fn entry(host: &mut impl Runtime) { | ||
// Every rollup has a Michelson type, declared at origination, which | ||
// represents the kind of data it can receive via internal transfer | ||
// messages. We won't delve into this here - for simplicity, the type | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# SPDX-FileCopyrightText: 2023 Marigold <[email protected]> | ||
# SPDX-FileCopyrightText: 2023 Nomadic Labs <[email protected]> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
[package] | ||
name = "filtering-kernel" | ||
version = "0.1.0" | ||
|
@@ -7,4 +12,4 @@ edition = "2021" | |
crate-type = ["cdylib", "lib"] | ||
|
||
[dependencies] | ||
tezos-smart-rollup = "0.1.0" | ||
tezos-smart-rollup = "0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load inputs | ||
step result |
Oops, something went wrong.