Skip to content

Commit

Permalink
Checkpoint accessors and new IPC bundle (filecoin-project#81)
Browse files Browse the repository at this point in the history
* fix actor state inspection and serialization

* checkpoint acessors and new ipc bundle

* address comments
  • Loading branch information
adlrocha authored Feb 23, 2023
1 parent a8e508d commit 21086ca
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 63 deletions.
9 changes: 6 additions & 3 deletions api/api_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/consensus-shipyard/go-ipc-types/gateway"
"github.com/consensus-shipyard/go-ipc-types/sdk"
"github.com/consensus-shipyard/go-ipc-types/subnetactor"
"github.com/google/uuid"
"github.com/ipfs/go-cid"
Expand Down Expand Up @@ -864,9 +865,11 @@ type FullNode interface {
// IPC-specific methods //

// IPCAddSubnetActor deploys a new subnet actor.
IpcAddSubnetActor(ctx context.Context, wallet address.Address, params subnetactor.ConstructParams) (address.Address, error) //perm:write
IpcReadGatewayState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*gateway.State, error) //perm:read
IpcReadSubnetActorState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*subnetactor.State, error) //perm:read
IPCAddSubnetActor(ctx context.Context, wallet address.Address, params subnetactor.ConstructParams) (address.Address, error) //perm:write
IPCReadGatewayState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*gateway.State, error) //perm:read
IPCReadSubnetActorState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*subnetactor.State, error) //perm:read
IPCGetPrevCheckpointForChild(ctx context.Context, gatewayAddr address.Address, subnet sdk.SubnetID) (cid.Cid, error) //perm:read
IPCGetCheckpointTemplate(ctx context.Context, gatewayAddr address.Address, epoch abi.ChainEpoch) (*gateway.Checkpoint, error) //perm:read
}

// reverse interface to the client, called after EthSubscribe
Expand Down
67 changes: 49 additions & 18 deletions api/mocks/mock_full.go

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

57 changes: 42 additions & 15 deletions api/proxy_gen.go

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

Binary file modified build/actors/ipc-actors.car
Binary file not shown.
Binary file modified build/openrpc/full.json.gz
Binary file not shown.
Binary file modified build/openrpc/gateway.json.gz
Binary file not shown.
Binary file modified build/openrpc/miner.json.gz
Binary file not shown.
Binary file modified build/openrpc/worker.json.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions cmd/eudico/ipc.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ var addCmd = &cli.Command{
params := subnetactor.ConstructParams{
Parent: parent,
Name: subnetName,
IpcGatewayAddr: gwAddr,
IPCGatewayAddr: gwAddr,
CheckPeriod: chp,
FinalityThreshold: finalityThreshold,
MinValidators: minVals,
MinValidatorStake: abi.TokenAmount(types.MustParseFIL("1FIL")),
Consensus: subnetactor.Mir,
}
actorAddr, err := api.IpcAddSubnetActor(ctx, addr, params)
actorAddr, err := api.IPCAddSubnetActor(ctx, addr, params)
if err != nil {
return err
}
Expand Down
102 changes: 91 additions & 11 deletions documentation/en/api-v1-unstable-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@
* [GasEstimateMessageGas](#GasEstimateMessageGas)
* [I](#I)
* [ID](#ID)
* [Ipc](#Ipc)
* [IpcAddSubnetActor](#IpcAddSubnetActor)
* [IpcReadGatewayState](#IpcReadGatewayState)
* [IpcReadSubnetActorState](#IpcReadSubnetActorState)
* [IPCAddSubnetActor](#IPCAddSubnetActor)
* [IPCGetCheckpointTemplate](#IPCGetCheckpointTemplate)
* [IPCGetPrevCheckpointForChild](#IPCGetPrevCheckpointForChild)
* [IPCReadGatewayState](#IPCReadGatewayState)
* [IPCReadSubnetActorState](#IPCReadSubnetActorState)
* [Log](#Log)
* [LogAlerts](#LogAlerts)
* [LogList](#LogList)
Expand Down Expand Up @@ -3109,10 +3110,7 @@ Inputs: `null`

Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"`

## Ipc


### IpcAddSubnetActor
### IPCAddSubnetActor
IPCAddSubnetActor deploys a new subnet actor.


Expand All @@ -3128,7 +3126,7 @@ Inputs:
"Actor": "f01234"
},
"Name": "string value",
"IpcGatewayAddr": 42,
"IPCGatewayAddr": 42,
"Consensus": 0,
"MinValidatorStake": "0",
"MinValidators": 42,
Expand All @@ -3141,7 +3139,89 @@ Inputs:

Response: `"f01234"`

### IpcReadGatewayState
### IPCGetCheckpointTemplate


Perms: read

Inputs:
```json
[
"f01234",
10101
]
```

Response:
```json
{
"Data": {
"Source": {
"Parent": "string value",
"Actor": "f01234"
},
"TipSet": "Ynl0ZSBhcnJheQ==",
"Epoch": 10101,
"PrevCheck": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Children": [
{
"Source": {
"Parent": "string value",
"Actor": "f01234"
},
"Checks": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
}
],
"CrossMsgs": [
{
"From": {
"Parent": "string value",
"Actor": "f01234"
},
"To": {
"Parent": "string value",
"Actor": "f01234"
},
"MsgsCID": {
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
},
"Nonce": 42,
"Value": "0"
}
]
},
"Sig": "Ynl0ZSBhcnJheQ=="
}
```

### IPCGetPrevCheckpointForChild


Perms: read

Inputs:
```json
[
"f01234",
{
"Parent": "string value",
"Actor": "f01234"
}
]
```

Response:
```json
{
"/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4"
}
```

### IPCReadGatewayState


Perms: read
Expand Down Expand Up @@ -3193,7 +3273,7 @@ Response:
}
```

### IpcReadSubnetActorState
### IPCReadSubnetActorState


Perms: read
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921
github.com/buger/goterm v1.0.3
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/consensus-shipyard/go-ipc-types v0.1.1
github.com/consensus-shipyard/go-ipc-types v0.1.2
github.com/containerd/cgroups v1.0.4
github.com/coreos/go-systemd/v22 v22.4.0
github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e
Expand Down Expand Up @@ -361,3 +361,6 @@ require (
replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi

replace github.com/filecoin-project/test-vectors => ./extern/test-vectors

// uncomment for local development. Keeping it here for now for convenience.
// replace github.com/consensus-shipyard/go-ipc-types => ../go-ipc-types
Loading

0 comments on commit 21086ca

Please sign in to comment.