Repository: tangle-network/gadget (language: rust)

Issue:
[BUG] Error: missing field `verifier` during cargo tangle blueprint deploy
Trying to deploy a hello world blueprint and it does not work.

Error:

```
❯ RUST_BACKTRACE=full cargo tangle blueprint deploy --rpc-url ws://localhost:9944
Chain ID: 3287
Deploying contract: FrostBlueprint ...
Contract FrostBlueprint deployed at: 0x9029fA62864B7c2cC4e352d89e8f97e198198E57
Job: {"gadget":{"Native":{"sources":[{"fetcher":{"Github":{"binaries":[{"arch":"Amd64","name":[97,109,100,54,52,45,108,105,110,117,120,45,102,114,111,115,116,45,98,108,117,101,112,114,105,110,116,45,103,97,100,103,101,116],"os":"Linux","sha256":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},{"arch":"Arm64","name":[97,114,109,54,52,45,108,105,110,117,120,45,102,114,111,115,116,45,98,108,117,101,112,114,105,110,116,45,103,97,100,103,101,116],"os":"Linux","sha256":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],"owner":[116,97,110,103,108,101,45,110,101,116,119,111,114,107],"repo":[102,114,111,115,116,45,98,108,117,101,112,114,105,110,116],"tag":[48,46,49,46,48]}}}]}},"jobs":[{"metadata":{"description":[82,101,116,117,114,110,115,32,34,72,101,108,108,111,32,87,111,114,108,100,33,34,32,105,102,32,96,119,104,111,96,32,105,115,32,96,78,111,110,101,96,44,32,111,116,104,101,114,119,105,115,101,32,114,101,116,117,114,110,115,32,34,72,101,108,108,111,44,32,123,119,104,111,125,33,34],"name":[115,97,121,95,104,101,108,108,111]},"params":[{"Optional":"String"}],"result":["String"]}],"manager":{"evm":"0x9029fA62864B7c2cC4e352d89e8f97e198198E57"},"metadata":{"author":[87,101,98,98,32,84,101,99,104,110,111,108,111,103,105,101,115,32,73,110,99,46],"category":null,"code_repository":[104,116,116,112,115,58,47,47,103,105,116,104,117,98,46,99,111,109,47,116,97,110,103,108,101,45,110,101,116,119,111,114,107,47,102,114,111,115,116,45,98,108,117,101,112,114,105,110,116],"description":[70,82,79,83,84,32,66,108,117,101,112,114,105,110,116,32,98,117,105,108,116,32,117,115,105,110,103,32,84,97,110,103,108,101,32,71,97,100,103,101,116,32,83,68,75],"license":[85,110,108,105,99,101,110,115,101],"logo":null,"name":[102,114,111,115,116,45,98,108,117,101,112,114,105,110,116],"website":[104,116,116,112,115,58,47,47,103,105,116,104,117,98,46,99,111,109,47,116,97,110,103,108,101,45,110,101,116,119,111,114,107,47,102,114,111,115,116,45,98,108,117,101,112,114,105,110,116]},"registration_params":[],"request_params":[]}
Error:
   0: missing field `verifier`

Location:
   /home/shady/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-tangle-0.2.0/src/deploy.rs:312

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮
   4: cargo_tangle::deploy::bake_blueprint::h655cc83441dd06b2
      at <unknown source file>:<unknown line>
   5: cargo_tangle::deploy::deploy_to_tangle::{{closure}}::h43a749fe09b1b0c4
      at <unknown source file>:<unknown line>
   6: tokio::runtime::park::CachedParkThread::block_on::hfce971b272e7ad24
      at <unknown source file>:<unknown line>
   7: tokio::runtime::context::runtime::enter_runtime::h1531e5667a54d1ac
      at <unknown source file>:<unknown line>
   8: cargo_tangle::main::h97167ef6f2e7749f
      at <unknown source file>:<unknown line>
   9: std::sys::backtrace::__rust_begin_short_backtrace::hd6de644f07a19c26
      at <unknown source file>:<unknown line>
  10: std::rt::lang_start::{{closure}}::h799a7c23e8698c0f
      at <unknown source file>:<unknown line>
  11: std::rt::lang_start_internal::h6f92389acb32f739
      at <unknown source file>:<unknown line>
  12: main<unknown>
      at <unknown source file>:<unknown line>
  13: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  14: __libc_start_main_alias_2<unknown>
      at <unknown source file>:<unknown line>
  15: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
```

It fails in this function here: https://github.com/tangle-network/gadget/blob/0a06ad9dd7005fb3fb8ff9dacb1eed937b66d3fe/cli/src/deploy.rs#L256


Discussion / hints:

Fix patch:
diff --git a/blueprints/incredible-squaring-eigenlayer/contracts/lib/forge-std b/blueprints/incredible-squaring-eigenlayer/contracts/lib/forge-std
index 035de35f5..1de6eecf8 160000
--- a/blueprints/incredible-squaring-eigenlayer/contracts/lib/forge-std
+++ b/blueprints/incredible-squaring-eigenlayer/contracts/lib/forge-std
@@ -1,1 +1,1 @@
-Subproject commit 035de35f5e366c8d6ed142aec4ccb57fe2dd87d4
+Subproject commit 1de6eecf821de7fe2c908cc48d3ab3dced20717f
diff --git a/blueprints/incredible-squaring/Cargo.toml b/blueprints/incredible-squaring/Cargo.toml
index 276a1ab07..55e1264b0 100644
--- a/blueprints/incredible-squaring/Cargo.toml
+++ b/blueprints/incredible-squaring/Cargo.toml
@@ -39,4 +39,4 @@ default = ["std"]
 std = []
 
 [package.metadata.blueprint]
-manager = { evm = "IncredibleSquaringBlueprint" }
+manager = { Evm = "IncredibleSquaringBlueprint" }
diff --git a/blueprints/incredible-squaring/contracts/lib/forge-std b/blueprints/incredible-squaring/contracts/lib/forge-std
index 035de35f5..1de6eecf8 160000
--- a/blueprints/incredible-squaring/contracts/lib/forge-std
+++ b/blueprints/incredible-squaring/contracts/lib/forge-std
@@ -1,1 +1,1 @@
-Subproject commit 035de35f5e366c8d6ed142aec4ccb57fe2dd87d4
+Subproject commit 1de6eecf821de7fe2c908cc48d3ab3dced20717f
diff --git a/blueprints/incredible-squaring/contracts/lib/tnt-core b/blueprints/incredible-squaring/contracts/lib/tnt-core
index fad7030fe..c1fa9c7c3 160000
--- a/blueprints/incredible-squaring/contracts/lib/tnt-core
+++ b/blueprints/incredible-squaring/contracts/lib/tnt-core
@@ -1,1 +1,1 @@
-Subproject commit fad7030fe53ea5d4a7576316880f5416fe656ee9
+Subproject commit c1fa9c7c3c5891aab9bd25002a434d93c54942cd
diff --git a/cli/src/deploy.rs b/cli/src/deploy.rs
index 07ab9f727..f51d28045 100644
--- a/cli/src/deploy.rs
+++ b/cli/src/deploy.rs
@@ -264,9 +264,16 @@ fn bake_blueprint(
     convert_to_bytes_or_null(&mut blueprint_json["metadata"]["website"]);
     convert_to_bytes_or_null(&mut blueprint_json["metadata"]["code_repository"]);
     convert_to_bytes_or_null(&mut blueprint_json["metadata"]["category"]);
+
+    // Set the Hooks to be empty to be compatible with the old blueprint format.
+    // This is because the new blueprint format has manager field instead of different hooks.
+    blueprint_json["registration_hook"] = serde_json::json!("None");
+    blueprint_json["request_hook"] = serde_json::json!("None");
     for job in blueprint_json["jobs"].as_array_mut().unwrap() {
         convert_to_bytes_or_null(&mut job["metadata"]["name"]);
         convert_to_bytes_or_null(&mut job["metadata"]["description"]);
+        // Set an empty verifier to be compatible with the old blueprint format.
+        job["verifier"] = serde_json::json!("None");
     }
 
     // Retrieves the Gadget information from the blueprint.json file.
@@ -308,7 +315,6 @@ fn bake_blueprint(
         }
     }
 
-    println!("Job: {blueprint_json}");
     let blueprint = serde_json::from_value(blueprint_json)?;
     Ok(blueprint)
 }
diff --git a/macros/blueprint-proc-macro-core/src/lib.rs b/macros/blueprint-proc-macro-core/src/lib.rs
index 28a5faf9a..905c94f69 100644
--- a/macros/blueprint-proc-macro-core/src/lib.rs
+++ b/macros/blueprint-proc-macro-core/src/lib.rs
@@ -201,7 +201,6 @@ pub struct ReportMetadata<'a> {
 
 /// Service Blueprint Manager is a smart contract that will manage the service lifecycle.
 #[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
-#[serde(rename_all = "lowercase")]
 #[non_exhaustive]
 pub enum BlueprintManager {
     /// A Smart contract that will manage the service lifecycle.
diff --git a/macros/playground/Cargo.toml b/macros/playground/Cargo.toml
index 74fbd3bd1..535198c02 100644
--- a/macros/playground/Cargo.toml
+++ b/macros/playground/Cargo.toml
@@ -9,7 +9,7 @@ repository.workspace = true
 publish = false
 
 [package.metadata.blueprint]
-manager = { evm = "" }
+manager = { Evm = "" }
 
 [[package.metadata.gadget.Native.sources]]
 owner = "tangle-network"


Test patch: