Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
03eee83
supra: file tree_r ffi
magik6k Aug 14, 2025
282fe74
wire up treerfile to go
magik6k Aug 14, 2025
ce2c90b
supra: using the correct node reader in file tree_r ffi
magik6k Aug 14, 2025
a674e85
tree_r links
magik6k Aug 14, 2025
2b6e13f
redefs, it works
magik6k Aug 14, 2025
c264939
missing test-supra cmd
magik6k Aug 14, 2025
1676a12
fast snap encode
magik6k Aug 15, 2025
d6a260a
encode-snap test
magik6k Aug 15, 2025
4cbf3c5
wire up fast-snap
magik6k Aug 15, 2025
2fd9def
make gen
magik6k Aug 15, 2025
da80e53
encode works
magik6k Aug 15, 2025
90e7d6b
fix: yield in PSClientPoll correctly
magik6k Aug 20, 2025
2c2ba11
faster webui history
magik6k Aug 20, 2025
5c98653
pspoll: Don't timeout the context
magik6k Aug 20, 2025
3f2451c
fix EpochPretty ddos
magik6k Aug 22, 2025
d08fabc
more robust dealdata
magik6k Aug 23, 2025
84a7d95
robusthttp metrics
magik6k Aug 23, 2025
b7a026d
enable is done this way round
magik6k Aug 25, 2025
bbe3948
pshare: prio snap
magik6k Aug 26, 2025
e95fbdb
encode bind to data
magik6k Aug 27, 2025
a6f6db4
make gen
magik6k Aug 27, 2025
76dd121
piecepark node dl limit
magik6k Aug 27, 2025
5139517
only park pieces locally when supra P2 isn't running
magik6k Aug 27, 2025
060f89b
fix commp canaccept
magik6k Aug 28, 2025
d21e5e4
fix build
magik6k Aug 28, 2025
8c75e3b
fix commp canaccept storage query
magik6k Aug 28, 2025
da5017d
aaaargh
magik6k Aug 28, 2025
5088cc2
prevent dupe piece park task
magik6k Aug 28, 2025
aa7bef3
expose piecepark min free pct
magik6k Aug 28, 2025
dd83b68
Do snap falloc
magik6k Sep 2, 2025
5f4f92d
Cache storage info in localstorage.Local calls for a bit
magik6k Sep 2, 2025
f4bfeb0
MoveStorage / UpgradeStore param tweaks
magik6k Sep 2, 2025
2f3ff2e
snap key no read
magik6k Sep 3, 2025
db586b2
snap: Parallel movestorage
magik6k Sep 4, 2025
e2a0cbb
snap mertics, ui fix
magik6k Sep 4, 2025
816b4d2
missing snap metrics
magik6k Sep 4, 2025
05bae8d
fix snap batch backoff
magik6k Sep 7, 2025
1af38c3
somewhat handle snap msg fails on immutable deadline
magik6k Sep 8, 2025
c21052f
fix snap retry query params
magik6k Sep 8, 2025
169b01f
storage: Copy over snap vproof
magik6k Sep 8, 2025
bc7486d
treeR file deadline
magik6k Sep 11, 2025
8c73ff5
slower retry movestorage
magik6k Sep 11, 2025
1cd556c
ipni: Handle orphan tasks
magik6k Sep 11, 2025
d7f5d8d
ipni: Accept orphans
magik6k Sep 11, 2025
be9f1b6
f05 bmgr
magik6k Sep 12, 2025
0e5a4b0
f05 bmgr fixes
magik6k Sep 12, 2025
bf300cb
fix f05 bm build
magik6k Sep 16, 2025
6f52344
make gen
magik6k Sep 23, 2025
9efac84
missing fixes postrebase
magik6k Sep 23, 2025
e500cad
fix: proofshare: Fix client payment chain bootstrap
magik6k Sep 28, 2025
26dbb10
feat: test post cli: Vanilla Proof test command
magik6k Oct 6, 2025
4f2ef5e
supra: live duration-so-far metric
magik6k Oct 7, 2025
8d632ee
webui: Content page
magik6k Oct 21, 2025
2d0a67a
fix: Make kubo retrievals work (#724)
magik6k Oct 23, 2025
f77ece8
add more caches
magik6k Oct 23, 2025
05bb2a0
more metrics, less log spam
magik6k Oct 23, 2025
9d8a8ec
http method in req stats
magik6k Oct 23, 2025
3c48a3e
http metric for in-flight requests
magik6k Oct 23, 2025
c6bb323
remotebs: return correct err on not-found
magik6k Oct 23, 2025
6bd92df
limit parallel retrievals
magik6k Oct 23, 2025
417b48c
separate head req limiter
magik6k Oct 23, 2025
f40d858
fix race condition that resulted in ignoring the last bit of cached d…
snadrus Oct 23, 2025
c4f47e3
merge iffy
snadrus Nov 14, 2025
c0efda1
Merge branch 'main' into andyfastsnap
snadrus Nov 14, 2025
b0d5f9e
gen
snadrus Nov 17, 2025
fa19779
lint and tests
snadrus Nov 17, 2025
274587c
old linter making mistakes
snadrus Nov 17, 2025
f2e25d8
linty
snadrus Nov 17, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ jobs:

- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.6.2
shell: bash

- name: Lint
Expand Down
1 change: 0 additions & 1 deletion api/api_chain_all.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !forest
// +build !forest

package api

Expand Down
1 change: 0 additions & 1 deletion api/api_chain_limited.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build forest
// +build forest

package api

Expand Down
1 change: 0 additions & 1 deletion build/params_2k.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build 2k
// +build 2k

package build

Expand Down
1 change: 0 additions & 1 deletion build/params_calibnet.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build calibnet
// +build calibnet

package build

Expand Down
1 change: 0 additions & 1 deletion build/params_mainnet.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build !calibnet && !debug && !2k
// +build !calibnet,!debug,!2k

package build

Expand Down
1 change: 0 additions & 1 deletion build/params_testnet.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//go:build debug
// +build debug

package build

Expand Down
1,422 changes: 712 additions & 710 deletions cmd/curio/internal/translations/catalog.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions cmd/curio/internal/translations/locales/en/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,13 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Supra consensus testing utilities",
"message": "Supra consensus testing utilities",
"translation": "Supra consensus testing utilities",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Tool Box for Curio",
"message": "Tool Box for Curio",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,12 @@
"translation": "PDP 지갑이 가져와졌습니다",
"message": "PDP wallet imported",
"placeholder": null
},
{
"id": "Supra consensus testing utilities",
"translation": "수프라 합의 테스트 유틸리티",
"message": "Supra consensus testing utilities",
"placeholder": null
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2901,6 +2901,12 @@
"translation": "1. 使用以下命令测试您的 PDP 服务:pdptool ping --service-url https://your-domain.com --service-name public",
"message": "1. Test your PDP service with: pdptool ping --service-url https://your-domain.com --service-name public",
"placeholder": null
},
{
"id": "Supra consensus testing utilities",
"translation": "超越共识测试工具",
"message": "Supra consensus testing utilities",
"placeholder": null
}
]
}
22 changes: 13 additions & 9 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,20 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
cfg.Subsystems.EnableProofShare ||
cfg.Subsystems.EnableRemoteProofs

var p2Active sealsupra.P2Active
if hasAnySealingTask {
sealingTasks, err := addSealingTasks(ctx, hasAnySealingTask, db, full, sender, as, cfg, slrLazy, asyncParams, si, stor, bstore, machine, prover)
sealingTasks, p2a, err := addSealingTasks(ctx, hasAnySealingTask, db, full, sender, as, cfg, slrLazy, asyncParams, si, stor, bstore, machine, prover)
if err != nil {
return nil, err
}
activeTasks = append(activeTasks, sealingTasks...)
p2Active = p2a
}

{
// Piece handling
if cfg.Subsystems.EnableParkPiece {
parkPieceTask, err := piece2.NewParkPieceTask(db, must.One(slrLazy.Val()), stor, cfg.Subsystems.ParkPieceMaxTasks)
parkPieceTask, err := piece2.NewParkPieceTask(db, must.One(slrLazy.Val()), stor, cfg.Subsystems.ParkPieceMaxTasks, cfg.Subsystems.ParkPieceMaxInPark, p2Active, cfg.Subsystems.ParkPieceMinFreeStoragePercent)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -268,7 +270,7 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
sdeps.DealMarket = dm

if cfg.Subsystems.EnableCommP {
commpTask := storage_market.NewCommpTask(dm, db, must.One(slrLazy.Val()), full, cfg.Subsystems.CommPMaxTasks)
commpTask := storage_market.NewCommpTask(dm, db, must.One(slrLazy.Val()), full, cfg.Subsystems.CommPMaxTasks, cfg.Subsystems.BindCommPToData)
activeTasks = append(activeTasks, commpTask)
}

Expand Down Expand Up @@ -385,7 +387,7 @@ func addSealingTasks(
ctx context.Context, hasAnySealingTask bool, db *harmonydb.DB, full api.Chain, sender *message.Sender,
as *multictladdr.MultiAddressSelector, cfg *config.CurioConfig, slrLazy *lazy.Lazy[*ffi.SealCalls],
asyncParams func() func() (bool, error), si paths.SectorIndex, stor *paths.Remote,
bstore curiochain.CurioBlockstore, machineHostPort string, prover storiface.Prover) ([]harmonytask.TaskInterface, error) {
bstore curiochain.CurioBlockstore, machineHostPort string, prover storiface.Prover) ([]harmonytask.TaskInterface, sealsupra.P2Active, error) {
var activeTasks []harmonytask.TaskInterface
// Sealing / Snap

Expand All @@ -407,18 +409,20 @@ func addSealingTasks(
activeTasks = append(activeTasks, scrubUnsealedTask)
}

var p2Active sealsupra.P2Active
if cfg.Subsystems.EnableBatchSeal {
batchSealTask, sm, err := sealsupra.NewSupraSeal(
batchSealTask, sm, p2a, err := sealsupra.NewSupraSeal(
cfg.Seal.BatchSealSectorSize,
cfg.Seal.BatchSealBatchSize,
cfg.Seal.BatchSealPipelines,
!cfg.Seal.SingleHasherPerThread,
cfg.Seal.LayerNVMEDevices,
machineHostPort, db, full, stor, si, slr)
if err != nil {
return nil, xerrors.Errorf("setting up batch sealer: %w", err)
return nil, nil, xerrors.Errorf("setting up batch sealer: %w", err)
}
slotMgr = sm
p2Active = p2a
activeTasks = append(activeTasks, batchSealTask)
addFinalize = true
}
Expand Down Expand Up @@ -457,7 +461,7 @@ func addSealingTasks(

storePieceTask, err := piece2.NewStorePieceTask(db, must.One(slrLazy.Val()), stor, cfg.Subsystems.MoveStorageMaxTasks)
if err != nil {
return nil, err
return nil, nil, err
}

activeTasks = append(activeTasks, moveStorageTask, moveStorageSnapTask, storePieceTask)
Expand All @@ -478,7 +482,7 @@ func addSealingTasks(
}

if cfg.Subsystems.EnableUpdateEncode {
encodeTask := snap.NewEncodeTask(slr, db, cfg.Subsystems.UpdateEncodeMaxTasks)
encodeTask := snap.NewEncodeTask(slr, db, cfg.Subsystems.UpdateEncodeMaxTasks, cfg.Subsystems.BindEncodeToData, cfg.Subsystems.AllowEncodeGPUOverprovision)
activeTasks = append(activeTasks, encodeTask)
}
if cfg.Subsystems.EnableUpdateProve || cfg.Subsystems.EnableRemoteProofs {
Expand Down Expand Up @@ -523,7 +527,7 @@ func addSealingTasks(
activeTasks = append(activeTasks, storageEndpointGcTask, pipelineGcTask, storageGcMarkTask, storageGcSweepTask, sectorMetadataTask)
}

return activeTasks, nil
return activeTasks, p2Active, nil
}

func machineDetails(deps *deps.Deps, activeTasks []harmonytask.TaskInterface, machineID int, machineName string) {
Expand Down
1 change: 1 addition & 0 deletions cmd/curio/test-cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var testCmd = &cli.Command{
//provingInfoCmd,
wdPostCmd,
testDebugCmd,
testSupraCmd,
},
Before: func(cctx *cli.Context) error {
return nil
Expand Down
205 changes: 205 additions & 0 deletions cmd/curio/test-supra.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
package main

import (
"bytes"
"fmt"
"io"
"os"
"time"

"github.com/ipfs/go-cid"
"github.com/urfave/cli/v2"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/curio/cmd/curio/internal/translations"
"github.com/filecoin-project/curio/lib/ffi/cunative"
"github.com/filecoin-project/curio/lib/supraffi"
)

var testSupraCmd = &cli.Command{
Name: "supra",
Usage: translations.T("Supra consensus testing utilities"),
Subcommands: []*cli.Command{
testSupraTreeRFileCmd,
testSnapEncodeCmd,
},
}

var testSupraTreeRFileCmd = &cli.Command{
Name: "tree-r-file",
Usage: "Test tree-r-file",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "last-layer-filename",
Usage: "Last layer filename",
Required: true,
},
&cli.StringFlag{
Name: "data-filename",
Usage: "Data filename",
Required: true,
},
&cli.StringFlag{
Name: "output-dir",
Usage: "Output directory",
Required: true,
},
&cli.Uint64Flag{
Name: "sector-size",
Usage: "Sector size",
Required: true,
},
},
Action: func(cctx *cli.Context) error {
res := supraffi.TreeRFile(cctx.String("last-layer-filename"), cctx.String("data-filename"), cctx.String("output-dir"), cctx.Uint64("sector-size"))
if res != 0 {
return xerrors.Errorf("tree-r-file failed: %d", res)
}
return nil
},
}

var testSnapEncodeCmd = &cli.Command{
Name: "snap-encode",
Usage: "Test snap-encode",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "sealed-filename",
Usage: "Sealed filename",
Required: true,
},
&cli.StringFlag{
Name: "unsealed-filename",
Usage: "Unsealed filename",
Required: true,
},
&cli.StringFlag{
Name: "update-filename",
Usage: "Update filename",
Required: true,
},
&cli.Uint64Flag{
Name: "sector-size",
Usage: "Sector size (bytes). Supported: 2048, 8388608, 549755813888, 34359738368, 68719476736",
Required: true,
},
&cli.StringFlag{
Name: "commd",
Usage: "Unsealed CommD CID (v1)",
Required: true,
},
&cli.StringFlag{
Name: "commk",
Usage: "SectorKey CommR (commK) CID (v1)",
Required: true,
},
&cli.BoolFlag{
Name: "membuffer",
Usage: "Use memory buffer instead of disk (load and store)",
Value: false,
},
},
Action: func(cctx *cli.Context) error {
sealedPath := cctx.String("sealed-filename")
unsealedPath := cctx.String("unsealed-filename")
updatePath := cctx.String("update-filename")
useMem := cctx.Bool("membuffer")

commD, err := cid.Parse(cctx.String("commd"))
if err != nil {
return xerrors.Errorf("parse commD: %w", err)
}
commK, err := cid.Parse(cctx.String("commk"))
if err != nil {
return xerrors.Errorf("parse commK: %w", err)
}

spt, err := proofFromSectorSize(cctx.Uint64("sector-size"))
if err != nil {
return err
}
ssize, err := spt.SectorSize()
if err != nil {
return err
}

start := time.Now()
if useMem {
sealedBytes, err := os.ReadFile(sealedPath)
if err != nil {
return xerrors.Errorf("read sealed: %w", err)
}
unsealedBytes, err := os.ReadFile(unsealedPath)
if err != nil {
return xerrors.Errorf("read unsealed: %w", err)
}

elapsed := time.Since(start)
mbps := float64(ssize) / elapsed.Seconds() / 1024.0 / 1024.0
fmt.Printf("Load time: %s\n", elapsed)
fmt.Printf("Load throughput: %.2f MB/s\n", mbps)

var outBuf bytes.Buffer
outBuf.Grow(int(ssize))
start = time.Now() //nolint:staticcheck // false positive: used on line 181
if err := cunative.EncodeSnap(spt, commD, commK, bytes.NewReader(sealedBytes), bytes.NewReader(unsealedBytes), &outBuf); err != nil {
return xerrors.Errorf("EncodeSnap: %w", err)
}
} else {
keyF, err := os.Open(sealedPath)
if err != nil {
return xerrors.Errorf("open sealed: %w", err)
}
defer func() { _ = keyF.Close() }()

dataF, err := os.Open(unsealedPath)
if err != nil {
return xerrors.Errorf("open unsealed: %w", err)
}
defer func() { _ = dataF.Close() }()

outF, err := os.OpenFile(updatePath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0o644)
if err != nil {
return xerrors.Errorf("create update: %w", err)
}
defer func() { _ = outF.Close() }()

if err := cunative.EncodeSnap(spt, commD, commK, keyF, dataF, outF); err != nil {
return xerrors.Errorf("EncodeSnap: %w", err)
}

if err := outF.Sync(); err != nil {
return xerrors.Errorf("sync update: %w", err)
}

_, _ = io.Copy(io.Discard, keyF)
_, _ = io.Copy(io.Discard, dataF)
start = time.Now()
}
elapsed := time.Since(start)
mbps := float64(ssize) / elapsed.Seconds() / 1024.0 / 1024.0
fmt.Printf("EncodeSnap time: %s\n", elapsed)
fmt.Printf("EncodeSnap throughput: %.2f MB/s\n", mbps)

return nil
},
}

func proofFromSectorSize(size uint64) (abi.RegisteredSealProof, error) {
switch size {
case 2 << 10:
return abi.RegisteredSealProof_StackedDrg2KiBV1_1, nil
case 8 << 20:
return abi.RegisteredSealProof_StackedDrg8MiBV1_1, nil
case 512 << 20:
return abi.RegisteredSealProof_StackedDrg512MiBV1_1, nil
case 32 << 30:
return abi.RegisteredSealProof_StackedDrg32GiBV1_1, nil
case 64 << 30:
return abi.RegisteredSealProof_StackedDrg64GiBV1_1, nil
default:
return 0, xerrors.Errorf("unsupported sector size: %d", size)
}
}
Loading
Loading