From 15809e4579cf8a2f752b716a3790754ecabff740 Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 19:54:26 +0200 Subject: [PATCH 1/7] add-possibility-to-incentivise-relayer-on-consumer-chain --- src/proxy.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/proxy.rs b/src/proxy.rs index 9e22cbd..e795446 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -1,5 +1,5 @@ use cosmwasm_schema::cw_serde; -use cosmwasm_std::{HexBinary, Timestamp}; +use cosmwasm_std::{Addr, HexBinary, Timestamp}; /// Max length that the job ID is allowed to have (in bytes) /// @@ -47,6 +47,9 @@ pub struct NoisCallback { pub published: Timestamp, /// The randomness. This is guaranteed to be 32 bytes long. pub randomness: HexBinary, + /// The relayer that brings the packet from Nois to the consumer chain. + /// Might be useful if the Dapp wants to incentivise the relayer operator + pub relayer: String, } /// This is just a helper to properly serialize the above callback. @@ -74,6 +77,7 @@ mod tests { "aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd", ) .unwrap(), + relayer: "relayer".to_string(), }, }; let ser = to_vec(&msg).unwrap(); From 205418aa5c01c5150e362845485aedc61a19acee Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 19:55:09 +0200 Subject: [PATCH 2/7] add-possibility-to-incentivise-relayer-on-consumer-chain --- src/proxy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proxy.rs b/src/proxy.rs index e795446..ed2f3bb 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -1,5 +1,5 @@ use cosmwasm_schema::cw_serde; -use cosmwasm_std::{Addr, HexBinary, Timestamp}; +use cosmwasm_std::{HexBinary, Timestamp}; /// Max length that the job ID is allowed to have (in bytes) /// From fab96502b69475eecd6e69f0fa2ac14e071a0731 Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 20:02:10 +0200 Subject: [PATCH 3/7] string -> Addr --- src/proxy.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proxy.rs b/src/proxy.rs index ed2f3bb..53e799a 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -1,5 +1,5 @@ use cosmwasm_schema::cw_serde; -use cosmwasm_std::{HexBinary, Timestamp}; +use cosmwasm_std::{Addr, HexBinary, Timestamp}; /// Max length that the job ID is allowed to have (in bytes) /// @@ -49,7 +49,7 @@ pub struct NoisCallback { pub randomness: HexBinary, /// The relayer that brings the packet from Nois to the consumer chain. /// Might be useful if the Dapp wants to incentivise the relayer operator - pub relayer: String, + pub relayer: Addr, } /// This is just a helper to properly serialize the above callback. @@ -77,7 +77,7 @@ mod tests { "aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd", ) .unwrap(), - relayer: "relayer".to_string(), + relayer: Addr::unchecked("relayer"), }, }; let ser = to_vec(&msg).unwrap(); From 1c55496cd19d86a210edf3baa2c3b524e4c26886 Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 20:19:19 +0200 Subject: [PATCH 4/7] add-changelog --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b44f1fd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.8.0] + +### Added + +- randomness simulator (a predictable random seed based on block hash) +- The callback now contains a field with the relayer address. This would allow Dapps to incentivise the relayer From 52516e611ce8b6834ea10e37d839ed26a757ce45 Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 20:24:37 +0200 Subject: [PATCH 5/7] fix-test --- src/proxy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proxy.rs b/src/proxy.rs index 53e799a..723aa1c 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -83,7 +83,7 @@ mod tests { let ser = to_vec(&msg).unwrap(); assert_eq!( ser, - br#"{"nois_receive":{"callback":{"job_id":"first","published":"1682086395000000000","randomness":"aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd"}}}"# + br#"{"nois_receive":{"callback":{"job_id":"first","published":"1682086395000000000","randomness":"aabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccddaabbccdd","relayer":"relayer"}}}"# ); } } From 3d8f1ecee3e50989959a66deb1641f946ffe9a85 Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 20:32:11 +0200 Subject: [PATCH 6/7] add-possibility-to-incentivise-relayer-on-consumer-chain --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 297c71c..149c815 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "nois" description = "The Nois standard library" repository = "https://github.com/noislabs/nois" -version = "0.7.0" +version = "0.8.0rc3" edition = "2021" license = "Apache-2.0" readme = "README.md" From 6ad40cab805bf5f3317c04af49aeebcf3288c3a2 Mon Sep 17 00:00:00 2001 From: Kais Date: Fri, 21 Jul 2023 20:37:24 +0200 Subject: [PATCH 7/7] add-possibility-to-incentivise-relayer-on-consumer-chain --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d709c48..3512416 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "nois" -version = "0.7.0" +version = "0.8.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", diff --git a/Cargo.toml b/Cargo.toml index 149c815..dbd55ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "nois" description = "The Nois standard library" repository = "https://github.com/noislabs/nois" -version = "0.8.0rc3" +version = "0.8.0" edition = "2021" license = "Apache-2.0" readme = "README.md"