From 231c9b19991859f9c84380163a934825b7fcf029 Mon Sep 17 00:00:00 2001 From: Sander Pick Date: Tue, 22 Apr 2025 17:22:12 -0700 Subject: [PATCH] chore: update for ipc#575 Signed-off-by: Sander Pick --- Cargo.lock | 94 +++++++++++++++++++++++--------------- Cargo.toml | 22 ++++----- cli/src/account.rs | 23 +++++----- cli/src/credit.rs | 3 +- cli/src/machine.rs | 3 +- cli/src/machine/bucket.rs | 5 +- cli/src/machine/timehub.rs | 5 +- cli/src/storage.rs | 3 +- cli/src/subnet.rs | 3 +- provider/src/util.rs | 2 +- sdk/src/account.rs | 10 ++-- sdk/src/credits.rs | 53 ++++++++++----------- sdk/src/ipc/manager.rs | 3 +- sdk/src/ipc/subnet.rs | 3 +- sdk/src/machine.rs | 3 +- sdk/src/machine/bucket.rs | 22 ++++----- sdk/src/machine/timehub.rs | 5 +- sdk/src/network.rs | 3 +- sdk/src/storage.rs | 41 +++++++---------- sdk/src/subnet.rs | 11 +++-- 20 files changed, 157 insertions(+), 160 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5bd2c7f..309e3c2f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2665,18 +2665,16 @@ dependencies = [ [[package]] name = "fendermint_actor_blobs_shared" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "data-encoding", "fil_actors_runtime", "frc42_dispatch", - "fvm_ipld_blockstore", "fvm_ipld_encoding", "fvm_shared", "num-derive 0.3.3", "num-traits", - "recall_actor_sdk", "recall_ipld", "serde", ] @@ -2684,7 +2682,7 @@ dependencies = [ [[package]] name = "fendermint_actor_bucket" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "blake3", @@ -2700,14 +2698,14 @@ dependencies = [ "num-traits", "recall_actor_sdk", "recall_ipld", - "recall_sol_facade", + "recall_sol_facade 0.1.1 (git+https://github.com/recallnet/contracts?rev=fcd7530181900ab196e76b0bbe34c8ac764be434)", "serde", ] [[package]] name = "fendermint_actor_eam" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -2728,7 +2726,7 @@ dependencies = [ [[package]] name = "fendermint_actor_machine" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "fil_actor_adm", @@ -2738,14 +2736,14 @@ dependencies = [ "fvm_ipld_encoding", "fvm_shared", "recall_actor_sdk", - "recall_sol_facade", + "recall_sol_facade 0.1.1 (git+https://github.com/recallnet/contracts?rev=fcd7530181900ab196e76b0bbe34c8ac764be434)", "serde", ] [[package]] name = "fendermint_actor_recall_config_shared" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "fendermint_actor_blobs_shared", "fil_actors_runtime", @@ -2760,7 +2758,7 @@ dependencies = [ [[package]] name = "fendermint_actor_timehub" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -2775,7 +2773,7 @@ dependencies = [ "num-derive 0.3.3", "num-traits", "recall_actor_sdk", - "recall_sol_facade", + "recall_sol_facade 0.1.1 (git+https://github.com/recallnet/contracts?rev=fcd7530181900ab196e76b0bbe34c8ac764be434)", "serde", "tracing", ] @@ -2783,7 +2781,7 @@ dependencies = [ [[package]] name = "fendermint_crypto" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "base64 0.21.7", @@ -2795,7 +2793,7 @@ dependencies = [ [[package]] name = "fendermint_eth_api" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "async-trait", @@ -2832,7 +2830,7 @@ dependencies = [ [[package]] name = "fendermint_rpc" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "async-trait", @@ -2859,7 +2857,7 @@ dependencies = [ [[package]] name = "fendermint_vm_actor_interface" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -2887,7 +2885,7 @@ dependencies = [ [[package]] name = "fendermint_vm_core" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "cid", "fnv", @@ -2901,7 +2899,7 @@ dependencies = [ [[package]] name = "fendermint_vm_encoding" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "cid", "fvm_shared", @@ -2914,7 +2912,7 @@ dependencies = [ [[package]] name = "fendermint_vm_genesis" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "fendermint_actor_eam", @@ -2932,7 +2930,7 @@ dependencies = [ [[package]] name = "fendermint_vm_message" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "blake2b_simd", @@ -2975,7 +2973,7 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "fil_actor_adm" version = "15.0.0-rc1" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -2989,14 +2987,14 @@ dependencies = [ "multihash", "num-derive 0.3.3", "num-traits", - "recall_sol_facade", + "recall_sol_facade 0.1.1 (git+https://github.com/recallnet/contracts?rev=bbd1a89c45296e092e2aa20b62abea155b45d91c)", "serde", ] [[package]] name = "fil_actor_eam" version = "15.0.0-rc1" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -3017,7 +3015,7 @@ dependencies = [ [[package]] name = "fil_actors_evm_shared" version = "15.0.0-rc1" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "fil_actors_runtime", "fvm_ipld_encoding", @@ -3030,7 +3028,7 @@ dependencies = [ [[package]] name = "fil_actors_runtime" version = "15.0.0-rc1" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "base64 0.21.7", @@ -3253,7 +3251,7 @@ dependencies = [ [[package]] name = "frc42_dispatch" version = "8.0.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "frc42_hasher", "frc42_macros", @@ -3266,7 +3264,7 @@ dependencies = [ [[package]] name = "frc42_hasher" version = "6.0.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "fvm_sdk", "fvm_shared", @@ -3276,7 +3274,7 @@ dependencies = [ [[package]] name = "frc42_macros" version = "6.0.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "blake2b_simd", "frc42_hasher", @@ -4527,7 +4525,7 @@ dependencies = [ [[package]] name = "ipc-api" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -4556,7 +4554,7 @@ dependencies = [ [[package]] name = "ipc-types" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -4580,7 +4578,7 @@ dependencies = [ [[package]] name = "ipc_actors_abis" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "ethers", @@ -5251,7 +5249,7 @@ dependencies = [ [[package]] name = "merkle-tree-rs" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "ethers", @@ -7074,16 +7072,15 @@ dependencies = [ [[package]] name = "recall_actor_sdk" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", - "fil_actors_evm_shared", "fil_actors_runtime", "fvm_ipld_encoding", "fvm_sdk", "fvm_shared", "num-traits", - "recall_sol_facade", + "recall_sol_facade 0.1.1 (git+https://github.com/recallnet/contracts?rev=fcd7530181900ab196e76b0bbe34c8ac764be434)", "serde", ] @@ -7114,7 +7111,7 @@ dependencies = [ [[package]] name = "recall_ipld" version = "0.1.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", @@ -7245,6 +7242,31 @@ dependencies = [ "walkdir", ] +[[package]] +name = "recall_sol_facade" +version = "0.1.1" +source = "git+https://github.com/recallnet/contracts?rev=fcd7530181900ab196e76b0bbe34c8ac764be434#fcd7530181900ab196e76b0bbe34c8ac764be434" +dependencies = [ + "alloy-primitives", + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "alloy-sol-types", + "anyhow", + "dunce", + "eyre", + "fvm_ipld_encoding", + "fvm_shared", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "serde", + "serde_json", + "syn 2.0.100", + "thiserror 2.0.12", + "walkdir", +] + [[package]] name = "redb" version = "2.4.0" @@ -9856,7 +9878,7 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vm_api" version = "1.0.0" -source = "git+https://github.com/recallnet/ipc.git?rev=71a76384609d4f9a3196edfc0ff058685ebc34c9#71a76384609d4f9a3196edfc0ff058685ebc34c9" +source = "git+https://github.com/recallnet/ipc.git?rev=e55113d7f732763124449a6d8e15ab2dad4f27fe#e55113d7f732763124449a6d8e15ab2dad4f27fe" dependencies = [ "anyhow", "cid", diff --git a/Cargo.toml b/Cargo.toml index a45488ab..07d383ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,18 +74,18 @@ tendermint-rpc = { version = "0.31.1", features = [ fvm_shared = "~4.3.0" fvm_ipld_encoding = "0.4.0" -fendermint_actor_blobs_shared = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_actor_bucket = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_actor_recall_config_shared = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_actor_machine = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_actor_timehub = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_crypto = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_eth_api = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_vm_actor_interface = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -fendermint_vm_message = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } +fendermint_actor_blobs_shared = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_actor_bucket = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_actor_recall_config_shared = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_actor_machine = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_actor_timehub = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_crypto = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_eth_api = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_vm_actor_interface = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +fendermint_vm_message = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } -ipc_actors_abis = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } -ipc-api = { git = "https://github.com/recallnet/ipc.git", rev = "71a76384609d4f9a3196edfc0ff058685ebc34c9" } +ipc_actors_abis = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } +ipc-api = { git = "https://github.com/recallnet/ipc.git", rev = "e55113d7f732763124449a6d8e15ab2dad4f27fe" } # Use below when working locally on ipc and this repo simultaneously. # Assumes the ipc checkout is in a sibling directory with the same name. diff --git a/cli/src/account.rs b/cli/src/account.rs index 3470038e..20633564 100644 --- a/cli/src/account.rs +++ b/cli/src/account.rs @@ -5,16 +5,13 @@ use std::time::Duration; use anyhow::anyhow; use clap::{Args, Subcommand, ValueEnum}; -use reqwest::Url; -use serde_json::{json, Value}; - use recall_provider::{ fvm_shared::{address::Address, econ::TokenAmount}, json_rpc::JsonRpcProvider, util::{get_eth_address, parse_address, parse_token_amount}, }; use recall_sdk::{ - account::TtlStatus as SdkTtlStatus, + account::AccountStatus as SdkAccountStatus, account::{Account, SetSponsorOptions, SetStatusOptions}, credits::{Balance, Credits}, ipc::subnet::EVMSubnet, @@ -25,6 +22,8 @@ use recall_signer::{ key::{parse_secret_key, random_secretkey, SecretKey}, AccountKind, EthAddress, Signer, SubnetID, Void, Wallet, }; +use reqwest::Url; +use serde_json::{json, Value}; use crate::credit::{handle_credit, CreditArgs}; use crate::{get_address, print_json, print_tx_json, AddressArgs, BroadcastMode, TxArgs}; @@ -161,7 +160,7 @@ pub struct SetStatusArgs { #[arg(long, value_parser = parse_address)] address: Address, /// TTL status to set. - status: TtlStatus, + status: AccountStatus, /// Broadcast mode for the transaction. #[arg(short, long, value_enum, env = "RECALL_BROADCAST_MODE", default_value_t = BroadcastMode::Commit)] broadcast_mode: BroadcastMode, @@ -169,9 +168,9 @@ pub struct SetStatusArgs { tx_args: TxArgs, } -/// The TTL status of an account. +/// The status of an account. #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)] -enum TtlStatus { +enum AccountStatus { /// Default TTL. Default, /// Reduced TTL. @@ -180,12 +179,12 @@ enum TtlStatus { Extended, } -impl TtlStatus { - pub fn get(&self) -> SdkTtlStatus { +impl AccountStatus { + pub fn get(&self) -> SdkAccountStatus { match self { - TtlStatus::Default => SdkTtlStatus::Default, - TtlStatus::Reduced => SdkTtlStatus::Reduced, - TtlStatus::Extended => SdkTtlStatus::Extended, + AccountStatus::Default => SdkAccountStatus::Default, + AccountStatus::Reduced => SdkAccountStatus::Reduced, + AccountStatus::Extended => SdkAccountStatus::Extended, } } } diff --git a/cli/src/credit.rs b/cli/src/credit.rs index 0c1b36d6..947ad11a 100644 --- a/cli/src/credit.rs +++ b/cli/src/credit.rs @@ -4,8 +4,6 @@ use std::collections::HashSet; use clap::{Args, Subcommand}; -use serde_json::json; - use recall_provider::{ fvm_shared::{address::Address, clock::ChainEpoch, econ::TokenAmount}, json_rpc::JsonRpcProvider, @@ -20,6 +18,7 @@ use recall_signer::{ key::{parse_secret_key, SecretKey}, AccountKind, Signer, Wallet, }; +use serde_json::json; use crate::{parse_address_list, print_json, print_tx_json, AddressArgs, BroadcastMode, TxArgs}; diff --git a/cli/src/machine.rs b/cli/src/machine.rs index c7531b7f..b6bf945c 100644 --- a/cli/src/machine.rs +++ b/cli/src/machine.rs @@ -3,8 +3,6 @@ use clap::{Args, Subcommand}; use ethers::utils::hex::ToHexExt; -use serde_json::json; - use recall_provider::{ fvm_shared::address::Address, json_rpc::JsonRpcProvider, @@ -12,6 +10,7 @@ use recall_provider::{ util::{get_eth_address, parse_address, parse_query_height}, }; use recall_sdk::{machine::info, network::NetworkConfig}; +use serde_json::json; use crate::print_json; diff --git a/cli/src/machine/bucket.rs b/cli/src/machine/bucket.rs index dff6ee98..60aea925 100644 --- a/cli/src/machine/bucket.rs +++ b/cli/src/machine/bucket.rs @@ -6,9 +6,6 @@ use std::path::PathBuf; use clap::{Args, Parser, Subcommand}; use ethers::utils::hex::ToHexExt; -use serde_json::{json, Value}; -use tokio::io::{self}; - use recall_provider::{ fvm_shared::{address::Address, clock::ChainEpoch, econ::TokenAmount}, json_rpc::{JsonRpcProvider, Url}, @@ -35,6 +32,8 @@ use recall_signer::{ key::{parse_secret_key, SecretKey}, AccountKind, Signer, Void, Wallet, }; +use serde_json::{json, Value}; +use tokio::io::{self}; use crate::{get_address, print_json, print_tx_json, AddressArgs, BroadcastMode, TxArgs}; diff --git a/cli/src/machine/timehub.rs b/cli/src/machine/timehub.rs index 5403d8fb..a3b7f06a 100644 --- a/cli/src/machine/timehub.rs +++ b/cli/src/machine/timehub.rs @@ -9,9 +9,6 @@ use cid::Cid; use clap::{Args, Subcommand}; use clap_stdin::FileOrStdin; use ethers::utils::hex::ToHexExt; -use serde_json::{json, Value}; -use tokio::io::AsyncReadExt; - use recall_provider::{ fvm_shared::address::Address, json_rpc::JsonRpcProvider, @@ -32,6 +29,8 @@ use recall_signer::{ key::{parse_secret_key, SecretKey}, AccountKind, Signer, Void, Wallet, }; +use serde_json::{json, Value}; +use tokio::io::AsyncReadExt; use crate::{get_address, print_json, print_tx_json, AddressArgs, BroadcastMode, TxArgs}; diff --git a/cli/src/storage.rs b/cli/src/storage.rs index a7038a00..4e845c4f 100644 --- a/cli/src/storage.rs +++ b/cli/src/storage.rs @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0, MIT use clap::{Args, Subcommand}; -use serde_json::json; - use recall_provider::json_rpc::JsonRpcProvider; use recall_sdk::{network::NetworkConfig, storage::Storage}; +use serde_json::json; use crate::{get_address, print_json, AddressArgs}; diff --git a/cli/src/subnet.rs b/cli/src/subnet.rs index 382a2102..4385f715 100644 --- a/cli/src/subnet.rs +++ b/cli/src/subnet.rs @@ -3,8 +3,6 @@ use clap::{Args, Subcommand}; use ethers::utils::hex::ToHexExt; -use serde_json::json; - use recall_provider::util::get_eth_address; use recall_provider::{ fvm_shared::{address::Address, clock::ChainEpoch}, @@ -19,6 +17,7 @@ use recall_sdk::{ TxParams, }; use recall_signer::{key::SecretKey, AccountKind, Wallet}; +use serde_json::json; use crate::{ parse_address, parse_secret_key, print_json, print_tx_json, AddressArgs, BroadcastMode, TxArgs, diff --git a/provider/src/util.rs b/provider/src/util.rs index cbaac7c7..b265836c 100644 --- a/provider/src/util.rs +++ b/provider/src/util.rs @@ -5,7 +5,7 @@ use std::str::FromStr; use anyhow::anyhow; -use fendermint_actor_blobs_shared::state::{Credit, TokenCreditRate}; +use fendermint_actor_blobs_shared::credit::{Credit, TokenCreditRate}; use fendermint_vm_actor_interface::eam::EthAddress; use fendermint_vm_message::query::FvmQueryHeight; use fvm_shared::{ diff --git a/sdk/src/account.rs b/sdk/src/account.rs index 466085e4..0e755bf5 100644 --- a/sdk/src/account.rs +++ b/sdk/src/account.rs @@ -1,12 +1,9 @@ // Copyright 2025 Recall Contributors // SPDX-License-Identifier: Apache-2.0, MIT -use fendermint_actor_blobs_shared::params::{SetAccountStatusParams, SetSponsorParams}; -use fendermint_actor_blobs_shared::Method::{SetAccountSponsor, SetAccountStatus}; +use fendermint_actor_blobs_shared::method::Method::{SetAccountSponsor, SetAccountStatus}; +use fendermint_actor_blobs_shared::{accounts::SetAccountStatusParams, credit::SetSponsorParams}; use fendermint_vm_actor_interface::blobs::BLOBS_ACTOR_ADDR; - -pub use fendermint_actor_blobs_shared::state::TtlStatus; - use recall_provider::{ fvm_ipld_encoding::RawBytes, fvm_shared::{address::Address, econ::TokenAmount}, @@ -20,6 +17,7 @@ use recall_signer::{Signer, SubnetID}; pub use crate::ipc::{manager::EvmManager, subnet::EVMSubnet}; pub use ethers::prelude::TransactionReceipt; +pub use fendermint_actor_blobs_shared::accounts::AccountStatus; /// Options for setting credit sponsor. #[derive(Clone, Default, Debug)] @@ -34,7 +32,7 @@ pub struct SetSponsorOptions { #[derive(Clone, Default, Debug)] pub struct SetStatusOptions { /// Status for the account to set. - pub status: TtlStatus, + pub status: AccountStatus, /// Broadcast mode for the transaction. pub broadcast_mode: BroadcastMode, /// Gas params for the transaction. diff --git a/sdk/src/credits.rs b/sdk/src/credits.rs index b1eeab08..2ee8a71e 100644 --- a/sdk/src/credits.rs +++ b/sdk/src/credits.rs @@ -5,15 +5,13 @@ use std::collections::HashMap; use anyhow::anyhow; use ethers::utils::hex::ToHexExt; -use fendermint_actor_blobs_shared::params::{ - ApproveCreditParams, BuyCreditParams, GetAccountParams, RevokeCreditParams, -}; -use fendermint_actor_blobs_shared::Method::{ - ApproveCredit, BuyCredit, GetAccount, GetStats, RevokeCredit, +use fendermint_actor_blobs_shared::{ + accounts::{Account, GetAccountParams}, + credit::{ApproveCreditParams, BuyCreditParams, CreditApproval, RevokeCreditParams}, + method::Method::{ApproveCredit, BuyCredit, GetAccount, GetStats, RevokeCredit}, + GetStatsReturn, }; use fendermint_vm_actor_interface::blobs::BLOBS_ACTOR_ADDR; -use serde::{Deserialize, Serialize}; - use recall_provider::{ fvm_ipld_encoding::{self, RawBytes}, fvm_shared::{address::Address, clock::ChainEpoch, econ::TokenAmount}, @@ -25,8 +23,9 @@ use recall_provider::{ {Client, Provider}, }; use recall_signer::Signer; +use serde::{Deserialize, Serialize}; -pub use fendermint_actor_blobs_shared::state::{Credit, TokenCreditRate}; +pub use fendermint_actor_blobs_shared::credit::{Credit, TokenCreditRate}; /// Options for buying credit. #[derive(Clone, Default, Debug)] @@ -77,7 +76,7 @@ pub struct Balance { pub credit_sponsor: Option, /// The chain epoch of the last debit. pub last_debit_epoch: Option, - /// Credit approvals to other accounts from this account, keyed by receiver. + /// Credit approvals to other accounts from this account, keyed by the receiver. pub approvals_to: HashMap, /// Credit approvals to this account from other accounts, keyed by sender. pub approvals_from: HashMap, @@ -102,8 +101,8 @@ impl Default for Balance { } } -impl From for Balance { - fn from(v: fendermint_actor_blobs_shared::state::AccountInfo) -> Self { +impl From for Balance { + fn from(v: Account) -> Self { let last_debit_epoch = if v.last_debit_epoch != 0 { Some(v.last_debit_epoch) } else { @@ -170,13 +169,13 @@ impl Default for Approval { } } -impl From for Approval { - fn from(v: fendermint_actor_blobs_shared::state::CreditApproval) -> Self { +impl From for Approval { + fn from(v: CreditApproval) -> Self { Self { credit_limit: v.credit_limit.map(|l| l.to_string()), credit_used: v.credit_used.to_string(), - gas_fee_limit: v.gas_fee_limit.map(|l| l.to_string()), - gas_fee_used: v.gas_fee_used.to_string(), + gas_fee_limit: v.gas_allowance_limit.map(|l| l.to_string()), + gas_fee_used: v.gas_allowance_used.to_string(), expiry: v.expiry, } } @@ -199,8 +198,8 @@ pub struct CreditStats { pub num_accounts: u64, } -impl From for CreditStats { - fn from(v: fendermint_actor_blobs_shared::params::GetStatsReturn) -> Self { +impl From for CreditStats { + fn from(v: GetStatsReturn) -> Self { Self { balance: v.balance.to_string(), credit_sold: v.credit_sold.to_string(), @@ -336,30 +335,28 @@ impl Credits { fn decode_stats(deliver_tx: &DeliverTx) -> anyhow::Result { let data = decode_bytes(deliver_tx)?; - fvm_ipld_encoding::from_slice::(&data) + fvm_ipld_encoding::from_slice::(&data) .map(|v| v.into()) - .map_err(|e| anyhow!("error parsing as CreditStats: {e}")) + .map_err(|e| anyhow!("error parsing credit stats: {e}")) } fn decode_balance(deliver_tx: &DeliverTx) -> anyhow::Result> { let data = decode_bytes(deliver_tx)?; - fvm_ipld_encoding::from_slice::>( - &data, - ) - .map(|v| v.map(|v| v.into())) - .map_err(|e| anyhow!("error parsing as Option: {e}")) + fvm_ipld_encoding::from_slice::>(&data) + .map(|v| v.map(|v| v.into())) + .map_err(|e| anyhow!("error parsing as balance: {e}")) } fn decode_buy(deliver_tx: &DeliverTx) -> anyhow::Result { let data = decode_bytes(deliver_tx)?; - fvm_ipld_encoding::from_slice::(&data) + fvm_ipld_encoding::from_slice::(&data) .map(|v| v.into()) - .map_err(|e| anyhow!("error parsing as Balance: {e}")) + .map_err(|e| anyhow!("error parsing balance: {e}")) } fn decode_approve(deliver_tx: &DeliverTx) -> anyhow::Result { let data = decode_bytes(deliver_tx)?; - fvm_ipld_encoding::from_slice::(&data) + fvm_ipld_encoding::from_slice::(&data) .map(|v| v.into()) - .map_err(|e| anyhow!("error parsing as CreditApproval: {e}")) + .map_err(|e| anyhow!("error parsing credit approval: {e}")) } diff --git a/sdk/src/ipc/manager.rs b/sdk/src/ipc/manager.rs index 3c094204..c473390e 100644 --- a/sdk/src/ipc/manager.rs +++ b/sdk/src/ipc/manager.rs @@ -21,10 +21,9 @@ use gateway_manager_facet::{FvmAddress, GatewayManagerFacet, SubnetID as Gateway use ipc_actors_abis::gateway_manager_facet; use ipc_api::evm::{fil_to_eth_amount, payload_to_evm_address}; use num_traits::ToPrimitive; -use reqwest::{header::HeaderValue, Client}; - use recall_provider::fvm_shared::{address::Address, econ::TokenAmount}; use recall_signer::{Signer, SubnetID}; +use reqwest::{header::HeaderValue, Client}; use crate::ipc::subnet::EVMSubnet; diff --git a/sdk/src/ipc/subnet.rs b/sdk/src/ipc/subnet.rs index 97ce1669..29442f42 100644 --- a/sdk/src/ipc/subnet.rs +++ b/sdk/src/ipc/subnet.rs @@ -3,10 +3,9 @@ use std::time::Duration; -use reqwest::Url; - use recall_provider::fvm_shared::address::Address; use recall_signer::SubnetID; +use reqwest::Url; /// The EVM subnet config parameters. #[derive(Debug, Clone)] diff --git a/sdk/src/machine.rs b/sdk/src/machine.rs index 2a7a1a16..9f1b23c1 100644 --- a/sdk/src/machine.rs +++ b/sdk/src/machine.rs @@ -11,8 +11,6 @@ use fendermint_vm_actor_interface::adm::{ Method::CreateExternal, Method::ListMetadata, ADM_ACTOR_ADDR, }; use fendermint_vm_actor_interface::eam::EthAddress; -use tendermint::abci::response::DeliverTx; - use recall_provider::{ fvm_ipld_encoding::{self, RawBytes}, fvm_shared::address::Address, @@ -24,6 +22,7 @@ use recall_provider::{ Client, Provider, }; use recall_signer::Signer; +use tendermint::abci::response::DeliverTx; pub mod bucket; pub mod timehub; diff --git a/sdk/src/machine/bucket.rs b/sdk/src/machine/bucket.rs index 729d4966..88b9fa4a 100644 --- a/sdk/src/machine/bucket.rs +++ b/sdk/src/machine/bucket.rs @@ -6,7 +6,7 @@ use std::{cmp::min, collections::HashMap, str::FromStr}; use anyhow::anyhow; use async_trait::async_trait; -use fendermint_actor_blobs_shared::state::{Hash, PublicKey}; +use fendermint_actor_blobs_shared::bytes::B256; use fendermint_actor_bucket::{ AddParams, DeleteParams, GetParams, ListObjectsReturn, ListParams, Method::{AddObject, DeleteObject, GetObject, ListObjects, UpdateObjectMetadata}, @@ -16,12 +16,6 @@ use fendermint_vm_actor_interface::adm::{CreateExternalReturn, Kind}; use indicatif::HumanDuration; use iroh_blobs::Hash as IrohHash; use peekable::tokio::AsyncPeekable; -use tendermint::abci::response::DeliverTx; -use tokio::io::{AsyncRead, AsyncSeekExt, AsyncWrite, AsyncWriteExt}; -use tokio::time::Instant; -use tokio_stream::StreamExt; -use tokio_util::io::ReaderStream; - use recall_provider::{ fvm_ipld_encoding, fvm_ipld_encoding::RawBytes, @@ -34,13 +28,19 @@ use recall_provider::{ Client, Provider, }; use recall_signer::Signer; +use tendermint::abci::response::DeliverTx; +use tokio::io::{AsyncRead, AsyncSeekExt, AsyncWrite, AsyncWriteExt}; +use tokio::time::Instant; +use tokio_stream::StreamExt; +use tokio_util::io::ReaderStream; + +pub use fendermint_actor_bucket::{Object, ObjectState}; use crate::progress::{new_message_bar, new_multi_bar, SPARKLE}; use crate::{ machine::{deploy_machine, Machine}, progress::new_progress_bar, }; -pub use fendermint_actor_bucket::{Object, ObjectState}; /// Maximum allowed object size in bytes. const MAX_OBJECT_LENGTH: u64 = 5_000_000_000; // 5GB @@ -219,10 +219,10 @@ impl Bucket { let node_addr = provider.node_addr().await?; let params = AddParams { - source: PublicKey(*node_addr.node_id.as_bytes()), + source: B256(*node_addr.node_id.as_bytes()), key: key.into(), - hash: Hash(*object_hash.as_bytes()), - recovery_hash: Hash(*metadata_hash.as_bytes()), + hash: B256(*object_hash.as_bytes()), + recovery_hash: B256(*metadata_hash.as_bytes()), size, ttl: options.ttl, metadata: options.metadata, diff --git a/sdk/src/machine/timehub.rs b/sdk/src/machine/timehub.rs index 24d5303b..fade31c7 100644 --- a/sdk/src/machine/timehub.rs +++ b/sdk/src/machine/timehub.rs @@ -11,9 +11,6 @@ use fendermint_actor_timehub::{ PushParams, }; use fendermint_vm_actor_interface::adm::{CreateExternalReturn, Kind}; -use serde::{Deserialize, Serialize}; -use tendermint::abci::response::DeliverTx; - use recall_provider::{ fvm_ipld_encoding::{self, RawBytes}, fvm_shared::address::Address, @@ -24,6 +21,8 @@ use recall_provider::{ Client, Provider, }; use recall_signer::Signer; +use serde::{Deserialize, Serialize}; +use tendermint::abci::response::DeliverTx; use crate::machine::{deploy_machine, Machine}; diff --git a/sdk/src/network.rs b/sdk/src/network.rs index 7e7dcff4..3d341ad6 100644 --- a/sdk/src/network.rs +++ b/sdk/src/network.rs @@ -8,8 +8,6 @@ use std::{collections::HashMap, fmt::Display}; use anyhow::anyhow; use ethers::utils::hex::ToHexExt; use recall_provider::util::get_eth_address; -use serde::{Deserialize, Deserializer, Serialize, Serializer}; - use recall_provider::{ fvm_shared::{ address::{self, Address, Error, Network as FvmNetwork}, @@ -19,6 +17,7 @@ use recall_provider::{ util::parse_address, }; use recall_signer::SubnetID; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; use crate::ipc::subnet::EVMSubnet; diff --git a/sdk/src/storage.rs b/sdk/src/storage.rs index f22b876a..25d1f727 100644 --- a/sdk/src/storage.rs +++ b/sdk/src/storage.rs @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0, MIT use anyhow::anyhow; -use fendermint_actor_blobs_shared::params::GetAccountParams; -use fendermint_actor_blobs_shared::Method::{GetAccount, GetStats}; +use fendermint_actor_blobs_shared::{ + accounts::{Account, GetAccountParams}, + method::Method::{GetAccount, GetStats}, + GetStatsReturn, +}; use fendermint_vm_actor_interface::blobs::BLOBS_ACTOR_ADDR; - -use serde::{Deserialize, Serialize}; -use tendermint::abci::response::DeliverTx; - use recall_provider::{ fvm_ipld_encoding, fvm_shared::address::Address, @@ -16,14 +15,8 @@ use recall_provider::{ query::{FvmQueryHeight, QueryProvider}, response::decode_bytes, }; - -// Commands to support: -// ✓ recall storage stats (subnet-wide summary) -// ✓ recall storage usage --address (see usage by account) -// recall storage add (add a blob directly) -// recall storage get [hash] (get a blob info directly) -// recall storage cat [hash] (get a blob directly) -// recall storage ls --address (list blobs by account) +use serde::{Deserialize, Serialize}; +use tendermint::abci::response::DeliverTx; /// Storage usage stats for an account. #[derive(Clone, Debug, Serialize, Deserialize)] @@ -40,8 +33,8 @@ impl Default for Usage { } } -impl From for Usage { - fn from(v: fendermint_actor_blobs_shared::state::AccountInfo) -> Self { +impl From for Usage { + fn from(v: Account) -> Self { Self { capacity_used: v.capacity_used.to_string(), } @@ -69,8 +62,8 @@ pub struct StorageStats { pub bytes_added: u64, } -impl From for StorageStats { - fn from(v: fendermint_actor_blobs_shared::params::GetStatsReturn) -> Self { +impl From for StorageStats { + fn from(v: GetStatsReturn) -> Self { Self { capacity_free: v.capacity_free.to_string(), capacity_used: v.capacity_used.to_string(), @@ -116,16 +109,14 @@ impl Storage { fn decode_stats(deliver_tx: &DeliverTx) -> anyhow::Result { let data = decode_bytes(deliver_tx)?; - fvm_ipld_encoding::from_slice::(&data) + fvm_ipld_encoding::from_slice::(&data) .map(|v| v.into()) - .map_err(|e| anyhow!("error parsing as StorageStats: {e}")) + .map_err(|e| anyhow!("error parsing as storage stats: {e}")) } fn decode_usage(deliver_tx: &DeliverTx) -> anyhow::Result> { let data = decode_bytes(deliver_tx)?; - fvm_ipld_encoding::from_slice::>( - &data, - ) - .map(|v| v.map(|v| v.into())) - .map_err(|e| anyhow!("error parsing as Option: {e}")) + fvm_ipld_encoding::from_slice::>(&data) + .map(|v| v.map(|v| v.into())) + .map_err(|e| anyhow!("error parsing as storage usage: {e}")) } diff --git a/sdk/src/subnet.rs b/sdk/src/subnet.rs index 74860616..eb5b2b6a 100644 --- a/sdk/src/subnet.rs +++ b/sdk/src/subnet.rs @@ -1,12 +1,12 @@ // Copyright 2025 Recall Contributors // SPDX-License-Identifier: Apache-2.0, MIT -use fendermint_actor_blobs_shared::state::TokenCreditRate; -use fendermint_actor_recall_config_shared::Method::{GetAdmin, GetConfig, SetAdmin, SetConfig}; -use fendermint_actor_recall_config_shared::{RecallConfig, SetAdminParams, SetConfigParams}; +use fendermint_actor_blobs_shared::credit::TokenCreditRate; +use fendermint_actor_recall_config_shared::{ + Method::{GetAdmin, GetConfig, SetAdmin, SetConfig}, + RecallConfig, SetAdminParams, SetConfigParams, +}; use fendermint_vm_actor_interface::recall_config::RECALL_CONFIG_ACTOR_ADDR; -use tendermint::chain; - use recall_provider::{ fvm_shared::{address::Address, clock::ChainEpoch}, json_rpc::JsonRpcProvider, @@ -17,6 +17,7 @@ use recall_provider::{ {Client, Provider, TendermintClient}, }; use recall_signer::Signer; +use tendermint::chain; /// Options for setting config admin. #[derive(Clone, Debug)]