Skip to content

Commit

Permalink
chore: upgrade curio to 1.24.2 and remove ffi dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
strahe committed Nov 13, 2024
1 parent 6a87a1d commit 8c1c111
Show file tree
Hide file tree
Showing 13 changed files with 2,635 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
- run: make ui-deps ui
- uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.23'
check-latest: true
cache-dependency-path: 'go.sum'
- run: |
make go-deps go-dist
make go-dist
cp curio-dashboard curio-dashboard-linux-amd64
- name: Upload release asset
if: github.event_name == 'release'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: make go-deps
go-version: '1.23'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
all: go-deps ui-deps ui go
all-in-one: go-deps ui-deps ui go-dist
all: ui-deps ui go
all-in-one: ui-deps ui go-dist
aio: all-in-one

go-deps:
git submodule update --init --recursive
make -C extern/filecoin-ffi

go:
go build -ldflags="-s -w" -o curio-dashboard ./cmd

Expand Down
1 change: 0 additions & 1 deletion extern/filecoin-ffi
Submodule filecoin-ffi deleted from 815fb3
39 changes: 39 additions & 0 deletions extern/filecoin-ffi/cgo/interface.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package cgo

import (
"context"

"github.com/filecoin-project/go-address"

"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
blockstore "github.com/ipfs/go-ipfs-blockstore"
)

type ConsensusFault struct {
// Address of the miner at fault (always an ID address).
Target address.Address
// Epoch of the fault, which is the higher epoch of the two blocks causing it.
Epoch abi.ChainEpoch
// Type of fault.
Type ConsensusFaultType
}

type ConsensusFaultType int64

const (
ConsensusFaultNone ConsensusFaultType = 0
ConsensusFaultDoubleForkMining ConsensusFaultType = 1
ConsensusFaultParentGrinding ConsensusFaultType = 2
ConsensusFaultTimeOffsetMining ConsensusFaultType = 3
)

type Externs interface {
GetChainRandomness(ctx context.Context, epoch abi.ChainEpoch) ([32]byte, error)
GetBeaconRandomness(ctx context.Context, epoch abi.ChainEpoch) ([32]byte, error)
VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte) (*ConsensusFault, int64)
TipsetCid(ctx context.Context, epoch abi.ChainEpoch) (cid.Cid, error)

blockstore.Blockstore
blockstore.Viewer
}
9 changes: 9 additions & 0 deletions extern/filecoin-ffi/cgo/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cgo

/*
#include "../filcrypto.h"
#include <stdlib.h>
*/
import "C"

type FvmMachine = C.InnerFvmMachine_t
Loading

0 comments on commit 8c1c111

Please sign in to comment.