Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/rpc/methods/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ impl RpcMethod<2> for AuthNew {
const PARAM_NAMES: [&'static str; 2] = ["permissions", "expirationSecs"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Admin;
const DESCRIPTION: Option<&'static str> =
Some("Creates a new JWT authentication token with the given permissions.");
type Params = (Vec<String>, Option<i64>);
type Ok = Vec<u8>;
async fn handle(
Expand All @@ -60,6 +62,8 @@ impl RpcMethod<1> for AuthVerify {
const PARAM_NAMES: [&'static str; 1] = ["headerRaw"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Verifies a JWT authentication token and returns its permissions.");
type Params = (String,);
type Ok = Vec<String>;
async fn handle(
Expand Down
3 changes: 3 additions & 0 deletions src/rpc/methods/beacon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ impl RpcMethod<1> for BeaconGetEntry {
const PARAM_NAMES: [&'static str; 1] = ["first"];
const API_PATHS: BitFlags<ApiPaths> = make_bitflags!(ApiPaths::V0); // Not supported in V1
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> = Some(
"Returns the drand beacon entry for the given epoch, blocking until it becomes available.",
);

type Params = (ChainEpoch,);
type Ok = BeaconEntry;
Expand Down
7 changes: 7 additions & 0 deletions src/rpc/methods/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ impl RpcMethod<0> for Session {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns a UUID that uniquely identifies this node for the current session.");

type Params = ();
type Ok = Uuid;
Expand All @@ -34,6 +36,8 @@ impl RpcMethod<0> for Version {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the node version, API version, and block delay.");

type Params = ();
type Ok = PublicVersion;
Expand All @@ -60,6 +64,7 @@ impl RpcMethod<0> for Shutdown {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Admin;
const DESCRIPTION: Option<&'static str> = Some("Shuts the node down.");

type Params = ();
type Ok = ();
Expand All @@ -80,6 +85,8 @@ impl RpcMethod<0> for StartTime {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the time at which the node was started.");

type Params = ();
type Ok = chrono::DateTime<chrono::Utc>;
Expand Down
3 changes: 3 additions & 0 deletions src/rpc/methods/market.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ impl RpcMethod<3> for MarketAddBalance {
const PARAM_NAMES: [&'static str; 3] = ["wallet", "address", "amount"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Sign;
const DESCRIPTION: Option<&'static str> = Some(
"Adds funds to the market actor escrow balance for the given address and returns the message CID.",
);

type Params = (Address, Address, BigInt);
type Ok = Cid;
Expand Down
11 changes: 11 additions & 0 deletions src/rpc/methods/msig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ impl RpcMethod<2> for MsigGetAvailableBalance {
const PARAM_NAMES: [&'static str; 2] = ["address", "tipsetKey"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> = Some(
"Returns the spendable balance of the given multisig (total balance minus the locked amount) at the given tipset.",
);

type Params = (Address, ApiTipsetKey);
type Ok = TokenAmount;
Expand Down Expand Up @@ -47,6 +50,9 @@ impl RpcMethod<2> for MsigGetPending {
const PARAM_NAMES: [&'static str; 2] = ["address", "tipsetKey"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> = Some(
"Returns the transactions awaiting approval in the given multisig at the given tipset.",
);

type Params = (Address, ApiTipsetKey);
type Ok = Vec<Transaction>;
Expand Down Expand Up @@ -82,6 +88,9 @@ impl RpcMethod<3> for MsigGetVested {
const PARAM_NAMES: [&'static str; 3] = ["address", "startTipsetKey", "endTipsetKey"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> = Some(
"Returns the amount that vested in the given multisig between the start and end tipsets.",
);

type Params = (Address, ApiTipsetKey, ApiTipsetKey);
type Ok = BigInt;
Expand Down Expand Up @@ -122,6 +131,8 @@ impl RpcMethod<2> for MsigGetVestingSchedule {
const PARAM_NAMES: [&'static str; 2] = ["address", "tsk"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the vesting schedule of the given multisig at the given tipset.");

type Params = (Address, ApiTipsetKey);
type Ok = MsigVesting;
Expand Down
2 changes: 2 additions & 0 deletions src/rpc/methods/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ impl RpcMethod<0> for NodeStatus {
const PARAM_NAMES: [&'static str; 0] = [];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the node's status, including sync and chain health information.");

type Params = ();
type Ok = NodeStatusResult;
Expand Down
4 changes: 4 additions & 0 deletions src/rpc/methods/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ impl RpcMethod<1> for SyncCheckBad {
const PARAM_NAMES: [&'static str; 1] = ["cid"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Read;
const DESCRIPTION: Option<&'static str> =
Some("Returns the reason the given block is marked bad, or an empty string if it is not.");

type Params = (Cid,);
type Ok = String;
Expand All @@ -45,6 +47,8 @@ impl RpcMethod<1> for SyncMarkBad {
const PARAM_NAMES: [&'static str; 1] = ["cid"];
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
const PERMISSION: Permission = Permission::Admin;
const DESCRIPTION: Option<&'static str> =
Some("Marks the block with the given CID as bad in the bad-block cache.");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the cache from here, should we also add use with caution like lotus ?.

@LesnyRumcajs LesnyRumcajs Jun 19, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the cache from here

why?

should we also add use with caution like lotus ?.

This method requires admin permissions, it's inherently supposed to be used with caution.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Just because it is user facing, so user shouldn't care if there is cache or something else, that's why.


type Params = (Cid,);
type Ok = ();
Expand Down
15 changes: 15 additions & 0 deletions src/rpc/snapshots/forest__rpc__tests__rpc__v0.snap

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

14 changes: 14 additions & 0 deletions src/rpc/snapshots/forest__rpc__tests__rpc__v1.snap

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

Loading