Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluencelabs/marine-rs-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: marine-rs-sdk-v0.12.0
Choose a base ref
...
head repository: fluencelabs/marine-rs-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: marine-rs-sdk-v0.13.0
Choose a head ref
  • 3 commits
  • 16 files changed
  • 2 contributors

Commits on Feb 20, 2024

  1. feat(host api)!: add particle parameters into CallParameters (#156)

    ValeryAntopol authored Feb 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8c7352e View commit details
  2. feat(host api)!: rename json_path field in SecurityTetraplet to `la…

    …mbda` to follow AquaVM naming (#158)
    
    rename json_path to lambda
    ValeryAntopol authored Feb 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4a9e72e View commit details
  3. chore(master): release marine-rs-sdk 0.13.0 (#157)

    * chore(master): release marine-rs-sdk 0.13.0
    
    * chore: Bump version to 0.13.0
    fluencebot authored Feb 20, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    53077ef View commit details
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.12.0"
".": "0.13.0"
}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [0.13.0](https://github.com/fluencelabs/marine-rs-sdk/compare/marine-rs-sdk-v0.12.0...marine-rs-sdk-v0.13.0) (2024-02-20)


### ⚠ BREAKING CHANGES

* **host api:** rename `json_path` field in SecurityTetraplet to `lambda` to follow AquaVM naming ([#158](https://github.com/fluencelabs/marine-rs-sdk/issues/158))
* **host api:** add particle parameters into CallParameters ([#156](https://github.com/fluencelabs/marine-rs-sdk/issues/156))

### Features

* **host api:** add particle parameters into CallParameters ([#156](https://github.com/fluencelabs/marine-rs-sdk/issues/156)) ([8c7352e](https://github.com/fluencelabs/marine-rs-sdk/commit/8c7352e599b7fdda7c29643b1d8138061f1b455d))
* **host api:** rename `json_path` field in SecurityTetraplet to `lambda` to follow AquaVM naming ([#158](https://github.com/fluencelabs/marine-rs-sdk/issues/158)) ([4a9e72e](https://github.com/fluencelabs/marine-rs-sdk/commit/4a9e72e64c5d18b14ae12311845bcf716f5532d5))

## [0.12.0](https://github.com/fluencelabs/marine-rs-sdk/compare/marine-rs-sdk-v0.11.0...marine-rs-sdk-v0.12.0) (2024-02-08)


14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-rs-sdk"
version = "0.12.0"
version = "0.13.0"
description = "Fluence backend SDK for developing backend applications for the Fluence network"
documentation = "https://docs.rs/fluence"
repository = "https://github.com/fluencelabs/marine-rs-sdk"
@@ -18,10 +18,10 @@ path = "src/lib.rs"
doctest = false

[dependencies]
marine-call-parameters = { path = "crates/call-parameters", version = "=0.12.0" }
marine-macro = { path = "crates/marine-macro", version = "=0.12.0" }
marine-rs-sdk-main = { path = "crates/main", version = "=0.12.0" } # warning: silent compilation break on minor verison bump. See docs/update-guide.md for details
marine-timestamp-macro = { path = "crates/timestamp-macro", version = "=0.12.0" }
marine-call-parameters = { path = "crates/call-parameters", version = "=0.13.0" }
marine-macro = { path = "crates/marine-macro", version = "=0.13.0" }
marine-rs-sdk-main = { path = "crates/main", version = "=0.13.0" } # warning: silent compilation break on minor verison bump. See docs/update-guide.md for details
marine-timestamp-macro = { path = "crates/timestamp-macro", version = "=0.13.0" }

serde = { version = "1.0.189", features = ["derive"]}

6 changes: 3 additions & 3 deletions crates/call-parameters/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-call-parameters"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
description = "Contains CallParameters and SecurityTetralets structures for marine-rs-sdk"
documentation = "https://docs.rs/fluence"
@@ -15,8 +15,8 @@ rkyv = { version = "0.7.43", features = ["validation", "strict"], optional = tru
serde = "1.0.189"

[target.'cfg(target_arch = "wasm32")'.dependencies]
marine-macro = { path = "../marine-macro", version = "=0.12.0" }
marine-rs-sdk-main = { path = "../main", version = "=0.12.0" }
marine-macro = { path = "../marine-macro", version = "=0.13.0" }
marine-rs-sdk-main = { path = "../main", version = "=0.13.0" }

[features]
default = ["marine-abi"]
60 changes: 43 additions & 17 deletions crates/call-parameters/src/lib.rs
Original file line number Diff line number Diff line change
@@ -38,23 +38,22 @@ pub struct SecurityTetraplet {
/// Name of a function that returned corresponding value.
pub function_name: String,

/// Value was produced by applying this `json_path` to the output from `call_service`.
// TODO: since it's not a json path anymore, it's needed to rename it to lambda
pub json_path: String,
/// Value was produced by applying this `lambda` to the output from `call_service`.
pub lambda: String,
}

impl SecurityTetraplet {
pub fn new(
peer_pk: impl Into<String>,
service_id: impl Into<String>,
function_name: impl Into<String>,
json_path: impl Into<String>,
lambda: impl Into<String>,
) -> Self {
Self {
peer_pk: peer_pk.into(),
service_id: service_id.into(),
function_name: function_name.into(),
json_path: json_path.into(),
lambda: lambda.into(),
}
}

@@ -66,13 +65,13 @@ impl SecurityTetraplet {
peer_pk: init_peer_id.into(),
service_id: String::new(),
function_name: String::new(),
// json path can't be applied to the string literals
json_path: String::new(),
// lambda can't be applied to the string literals
lambda: String::new(),
}
}

pub fn add_lambda(&mut self, json_path: &str) {
self.json_path.push_str(json_path)
pub fn add_lambda(&mut self, lambda: &str) {
self.lambda.push_str(lambda)
}
}

@@ -85,8 +84,8 @@ impl SecurityTetraplet {
)]
#[cfg_attr(feature = "rkyv", archive(check_bytes))]
pub struct CallParameters {
/// Peer id of the AIR script initiator.
pub init_peer_id: String,
/// Parameters of the particle that caused this call.
pub particle: ParticleParameters,

/// Id of the current service.
pub service_id: String,
@@ -100,20 +99,47 @@ pub struct CallParameters {
/// PeerId of the worker who hosts this service.
pub worker_id: String,

/// Id of the particle which execution resulted a call this service.
pub particle_id: String,

/// Security tetraplets which described origin of the arguments.
pub tetraplets: Vec<Vec<SecurityTetraplet>>,
}

#[cfg_attr(all(target_arch = "wasm32", feature = "marine-abi"), marine)]
#[derive(Clone, PartialEq, Default, Eq, Debug, Serialize, Deserialize)]
#[cfg_attr(
feature = "rkyv",
derive(::rkyv::Archive, ::rkyv::Serialize, ::rkyv::Deserialize)
)]
#[cfg_attr(feature = "rkyv", archive(check_bytes))]
pub struct ParticleParameters {
/// Id of the particle which execution resulted a call this service.
pub id: String,

/// Peer id of the AIR script initiator.
pub init_peer_id: String,

/// Unix timestamp of the particle start time.
pub timestamp: u64,

/// Time to live for this particle in milliseconds.
pub ttl: u32,

/// AIR script in this particle.
pub script: String,

/// Signature made by particle initiator -- init_peer_id.
pub signature: Vec<u8>,

/// particle.signature signed by host_id -- used for FS access.
pub token: String,
}

use std::fmt;
impl fmt::Display for SecurityTetraplet {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"peer_pk: {}, service_id: {}, function_name: {}, json_path: {}",
self.peer_pk, self.service_id, self.function_name, self.json_path
"peer_pk: {}, service_id: {}, function_name: {}, lambda: {}",
self.peer_pk, self.service_id, self.function_name, self.lambda
)
}
}
@@ -136,7 +162,7 @@ pub fn get_call_parameters() -> CallParameters {
}

#[cfg(all(feature = "marine-abi", target_arch = "wasm32"))]
#[link(wasm_import_module = "__marine_host_api_v1")]
#[link(wasm_import_module = "__marine_host_api_v2")]
#[allow(improper_ctypes)]
extern "C" {
// returns serialized current call parameters
2 changes: 1 addition & 1 deletion crates/macro-testing-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-macro-testing-utils"
version = "0.12.0"
version = "0.13.0"
edition = "2018"
description = "Some functions for testing procedural macros"
documentation = "https://docs.rs/fluence/marine-macro-testing-utils"
2 changes: 1 addition & 1 deletion crates/main/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-rs-sdk-main"
version = "0.12.0"
version = "0.13.0"
edition = "2018"
description = "Contains logger, allocators and several other modules for marine-rs-sdk"
documentation = "https://docs.rs/marine-rs-sdk-main"
2 changes: 1 addition & 1 deletion crates/main/src/lib.rs
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::needless_doctest_main)]
#![doc(html_root_url = "https://docs.rs/marine-rs-sdk-main/0.12.0")] // x-release-please-version
#![doc(html_root_url = "https://docs.rs/marine-rs-sdk-main/0.13.0")] // x-release-please-version
#![deny(
dead_code,
nonstandard_style,
2 changes: 1 addition & 1 deletion crates/main/src/logger.rs
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ pub fn log_utf8_string(level: i32, target: i32, msg_ptr: i32, msg_size: i32) {
/// TODO: mark `log_utf8_string_impl` as #[wasm_bindgen], so it is polyfilled by bindgen
/// log_utf8_string should be provided directly by a host.
#[cfg(all(feature = "marine-abi", target_arch = "wasm32"))]
#[link(wasm_import_module = "__marine_host_api_v1")]
#[link(wasm_import_module = "__marine_host_api_v2")]
extern "C" {
// Writes a byte string of size bytes that starts from ptr to a logger
#[link_name = "log_utf8_string"]
2 changes: 1 addition & 1 deletion crates/marine-macro-impl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-macro-impl"
version = "0.12.0"
version = "0.13.0"
edition = "2018"
description = "Implementation of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro-impl"
2 changes: 1 addition & 1 deletion crates/marine-macro-impl/src/lib.rs
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* limitations under the License.
*/

#![doc(html_root_url = "https://docs.rs/marine-macro-impl/0.12.0")] // x-release-please-version
#![doc(html_root_url = "https://docs.rs/marine-macro-impl/0.13.0")] // x-release-please-version
#![deny(
dead_code,
nonstandard_style,
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ use syn::spanned::Spanned;
const LINK_NAME_DIRECTIVE_NAME: &str = "link_name";
const HOST_IMPORT_DIRECTIVE_NAME: &str = "host_import";
const MODULE_IMPORT_DIRECTIVE_NAME: &str = "module_import";
const HOST_IMPORT_NAMESPACE: &str = "__marine_host_api_v1";
const HOST_IMPORT_NAMESPACE: &str = "__marine_host_api_v2";

impl ParseMacroInput for syn::ItemForeignMod {
fn parse_macro_input(self) -> Result<MarineAst> {
6 changes: 3 additions & 3 deletions crates/marine-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-macro"
version = "0.12.0"
version = "0.13.0"
edition = "2018"
description = "Definition of the `#[marine]` macro"
documentation = "https://docs.rs/fluence/marine-macro"
@@ -18,5 +18,5 @@ proc-macro = true
doctest = false

[dependencies]
marine-macro-impl = { path = "../marine-macro-impl", version = "=0.12.0" }
marine-rs-sdk-main = { path = "../main", version = "=0.12.0" }
marine-macro-impl = { path = "../marine-macro-impl", version = "=0.13.0" }
marine-rs-sdk-main = { path = "../main", version = "=0.13.0" }
2 changes: 1 addition & 1 deletion crates/timestamp-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "marine-timestamp-macro"
version = "0.12.0"
version = "0.13.0"
edition = "2018"
description = "Definition of the `#[build_timestamp]` macro"
documentation = "https://docs.rs/fluence/marine-timestamp-macro"
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@
//! pub fn curl_get(url: String) -> String;
//! }
//! ```
#![doc(html_root_url = "https://docs.rs/sdk/0.12.0")] // x-release-please-version
#![doc(html_root_url = "https://docs.rs/sdk/0.13.0")] // x-release-please-version
#![deny(
dead_code,
nonstandard_style,
@@ -77,6 +77,7 @@ pub use marine_macro::marine;
pub use marine_macro::fce;

pub use marine_call_parameters::CallParameters;
pub use marine_call_parameters::ParticleParameters;
pub use marine_call_parameters::SecurityTetraplet;
pub use marine_call_parameters::get_call_parameters;