Skip to content

Commit

Permalink
feat: curioweb: Sector info page
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Apr 6, 2024
1 parent dd6fef8 commit a4d2e21
Show file tree
Hide file tree
Showing 22 changed files with 629 additions and 379 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
cancel-in-progress: true

permissions: {}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
cancel-in-progress: true

permissions: {}

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
cancel-in-progress: true

permissions: {}

Expand Down
14 changes: 0 additions & 14 deletions chain/stmgr/forks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,20 +375,6 @@ func testForkRefuseCall(t *testing.T, nullsBefore, nullsAfter int) {
}

func TestForkPreMigration(t *testing.T) {
// Backup the original value of the DISABLE_PRE_MIGRATIONS environment variable
originalValue, _ := os.LookupEnv("LOTUS_DISABLE_PRE_MIGRATIONS")

// Unset the DISABLE_PRE_MIGRATIONS environment variable for the test
if err := os.Unsetenv("LOTUS_DISABLE_PRE_MIGRATIONS"); err != nil {
t.Fatalf("failed to unset LOTUS_DISABLE_PRE_MIGRATIONS: %v", err)
}

// Restore the original DISABLE_PRE_MIGRATIONS environment variable at the end of the test
defer func() {
if err := os.Setenv("LOTUS_DISABLE_PRE_MIGRATIONS", originalValue); err != nil {
t.Fatalf("failed to restore LOTUS_DISABLE_PRE_MIGRATIONS: %v", err)
}
}()
//stm: @CHAIN_GEN_NEXT_TIPSET_001,
//stm: @CHAIN_STATE_RESOLVE_TO_KEY_ADDR_001, @CHAIN_STATE_SET_VM_CONSTRUCTOR_001
logging.SetAllLoggers(logging.LevelInfo)
Expand Down
22 changes: 0 additions & 22 deletions cli/spcli/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"sort"
"strconv"
"strings"
"sync"
"time"

"github.com/fatih/color"
Expand Down Expand Up @@ -110,27 +109,6 @@ func SectorsStatusCmd(getActorAddress ActorAddressGetter, getOnDiskInfo OnDiskIn
fmt.Printf("OnTime:\t\t%v\n", status.OnTime)
fmt.Printf("Early:\t\t%v\n", status.Early)

var pamsHeaderOnce sync.Once

for pi, piece := range status.Pieces {
if piece.DealInfo == nil {
continue
}
if piece.DealInfo.PieceActivationManifest == nil {
continue
}
pamsHeaderOnce.Do(func() {
fmt.Printf("\nPiece Activation Manifests\n")
})

pam := piece.DealInfo.PieceActivationManifest

fmt.Printf("Piece %d: %s %s verif-alloc:%+v\n", pi, pam.CID, types.SizeStr(types.NewInt(uint64(pam.Size))), pam.VerifiedAllocationKey)
for ni, notification := range pam.Notify {
fmt.Printf("\tNotify %d: %s (%x)\n", ni, notification.Address, notification.Payload)
}
}

} else {
onChainInfo = true
}
Expand Down
9 changes: 0 additions & 9 deletions cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,6 @@ var sectorsListCmd = &cli.Command{
}
}

var pams int
for _, p := range st.Pieces {
if p.DealInfo != nil && p.DealInfo.PieceActivationManifest != nil {
pams++
}
}

exp := st.Expiration
if st.OnTime > 0 && st.OnTime < exp {
exp = st.OnTime // Can be different when the sector was CC upgraded
Expand All @@ -331,8 +324,6 @@ var sectorsListCmd = &cli.Command{

if deals > 0 {
m["Deals"] = color.GreenString("%d", deals)
} else if pams > 0 {
m["Deals"] = color.MagentaString("DDO:%d", pams)
} else {
m["Deals"] = color.BlueString("CC")
if st.ToUpgrade {
Expand Down
9 changes: 9 additions & 0 deletions curiosrc/web/hapi/robust_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ import (
"context"
"time"

lru "github.com/hashicorp/golang-lru/v2"
blocks "github.com/ipfs/go-block-format"

"github.com/filecoin-project/lotus/api/client"
"github.com/filecoin-project/lotus/blockstore"
"github.com/filecoin-project/lotus/chain/store"
cliutil "github.com/filecoin-project/lotus/cli/util"
"github.com/filecoin-project/lotus/lib/must"
)

var ChainBlockCache = must.One(lru.New[blockstore.MhString, blocks.Block](4096))

func (a *app) watchRpc() {
ticker := time.NewTicker(watchInterval)
for {
Expand Down Expand Up @@ -84,6 +92,7 @@ func (a *app) updateRpc(ctx context.Context) error {
}()

a.workingApi = v1api
a.stor = store.ActorStore(ctx, blockstore.NewReadCachedBlockstore(blockstore.NewAPIBlockstore(a.workingApi), ChainBlockCache))
}
}

Expand Down
3 changes: 3 additions & 0 deletions curiosrc/web/hapi/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func Routes(r *mux.Router, deps *deps.Deps) error {

// node info page
r.HandleFunc("/node/{id}", a.nodeInfo)

// sector info page
r.HandleFunc("/sector/{sp}/{id}", a.sectorInfo)
return nil
}

Expand Down
Loading

0 comments on commit a4d2e21

Please sign in to comment.