Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve sector UI page #353

Merged
merged 6 commits into from
Jan 13, 2025
Merged
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
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#####################################
ARG LOTUS_TEST_IMAGE=curio/lotus-all-in-one:latest
FROM ${LOTUS_TEST_IMAGE} as lotus-test
FROM golang:1.22.3-bullseye AS curio-builder
MAINTAINER Curio Development Team
FROM ${LOTUS_TEST_IMAGE} AS lotus-test
FROM golang:1.22.8-bullseye AS curio-builder
LABEL Maintainer = "Curio Development Team"

RUN apt-get update && apt-get install -y ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev

Expand Down Expand Up @@ -43,6 +43,7 @@ RUN make clean deps

ARG RUSTFLAGS=""
ARG GOFLAGS=""
ARG CURIO_TAGS=""

RUN make build

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ deps: $(BUILD_DEPS)

## ldflags -s -w strips binary

CURIO_TAGS := cunative
CURIO_TAGS ?= cunative

curio: $(BUILD_DEPS)
rm -f curio
Expand Down Expand Up @@ -264,7 +264,7 @@ build_lotus?=0
curio_docker_user?=curio
curio_base_image=$(curio_docker_user)/curio-all-in-one:latest-debug
ffi_from_source?=0
lotus_version?=v1.30.0-rc2
lotus_version?=v1.32.0-rc1

ifeq ($(build_lotus),1)
# v1: building lotus image with provided lotus version
Expand Down Expand Up @@ -301,7 +301,7 @@ curio_docker_build_cmd=docker build --build-arg CURIO_TEST_IMAGE=$(curio_base_im

docker/curio-all-in-one:
$(curio_docker_build_cmd) -f Dockerfile --target curio-all-in-one \
-t $(curio_base_image) --build-arg GOFLAGS=-tags=debug .
-t $(curio_base_image) --build-arg CURIO_TAGS="cunative debug" .
.PHONY: docker/curio-all-in-one

docker/lotus:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
name: curio-devnet

x-logging:
Expand Down Expand Up @@ -27,6 +26,7 @@ services:
- LOTUS_FEVM_ENABLEETHRPC=true
- LOTUS_API_LISTENADDRESS=/dns/lotus/tcp/1234/http
- LOTUS_LIBP2P_LISTENADDRESSES=/ip4/0.0.0.0/tcp/9090
- LOTUS_CHAININDEXER_ENABLEINDEXER=true
restart: unless-stopped
logging: *default-logging
volumes:
Expand Down
102 changes: 78 additions & 24 deletions web/api/webrpc/market.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ type StorageDealSummary struct {
Miner string `json:"miner"`
IsLegacy bool `json:"is_legacy"`
Indexed *bool `db:"indexed" json:"indexed"`
IsDDO bool `db:"is_ddo" json:"is_ddo"`
}

func (a *WebRPC) StorageDealInfo(ctx context.Context, deal string) (*StorageDealSummary, error) {
Expand All @@ -207,30 +208,83 @@ func (a *WebRPC) StorageDealInfo(ctx context.Context, deal string) (*StorageDeal
if !isLegacy {
var summaries []StorageDealSummary
err = a.deps.DB.Select(ctx, &summaries, `SELECT
md.uuid,
md.sp_id,
md.created_at,
md.signed_proposal_cid,
md.offline,
md.verified,
md.start_epoch,
md.end_epoch,
md.client_peer_id,
md.chain_deal_id,
md.publish_cid,
md.piece_cid,
md.piece_size,
md.fast_retrieval,
md.announce_to_ipni,
md.url,
md.url_headers,
md.error,
mpd.sector_num,
mpm.indexed
FROM market_mk12_deals md
LEFT JOIN market_piece_deal mpd ON mpd.id = md.uuid AND mpd.sp_id = md.sp_id
LEFT JOIN market_piece_metadata mpm ON mpm.piece_cid = md.piece_cid
WHERE md.uuid = $1`, id.String())
deal.uuid,
deal.sp_id,
deal.created_at,
deal.signed_proposal_cid,
deal.offline,
deal.verified,
deal.start_epoch,
deal.end_epoch,
deal.client_peer_id,
deal.chain_deal_id,
deal.publish_cid,
deal.piece_cid,
deal.piece_size,
deal.fast_retrieval,
deal.announce_to_ipni,
deal.url,
deal.url_headers,
deal.error,
mpd.sector_num,
mpm.indexed,
deal.is_ddo -- New column indicating whether the deal is from market_direct_deals
FROM (
-- Query from market_mk12_deals (default, original table)
SELECT
md.uuid,
md.sp_id,
md.created_at,
md.signed_proposal_cid,
md.offline,
md.verified,
md.start_epoch,
md.end_epoch,
md.client_peer_id,
md.chain_deal_id,
md.publish_cid,
md.piece_cid,
md.piece_size,
md.fast_retrieval,
md.announce_to_ipni,
md.url,
md.url_headers,
md.error,
FALSE AS is_ddo -- Not from market_direct_deals
FROM market_mk12_deals md
WHERE md.uuid = $1
UNION ALL
-- Query from market_direct_deals (new table)
SELECT
mdd.uuid,
mdd.sp_id,
mdd.created_at,
'' AS signed_proposal_cid,
mdd.offline,
mdd.verified,
mdd.start_epoch,
mdd.end_epoch,
'' AS client_peer_id,
0 AS chain_deal_id,
'' AS publish_cid,
mdd.piece_cid,
mdd.piece_size,
mdd.fast_retrieval,
mdd.announce_to_ipni,
'' AS url,
'{}' AS url_headers,
'' AS error,
TRUE AS is_ddo -- From market_direct_deals
FROM market_direct_deals mdd
WHERE mdd.uuid = $1
) AS deal
LEFT JOIN market_piece_deal mpd
ON mpd.id = deal.uuid AND mpd.sp_id = deal.sp_id
LEFT JOIN market_piece_metadata mpm
ON mpm.piece_cid = deal.piece_cid;
`, id.String())

if err != nil {
return &StorageDealSummary{}, xerrors.Errorf("select deal summary: %w", err)
Expand Down
20 changes: 12 additions & 8 deletions web/api/webrpc/pipeline_porep.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ type PipelineTask struct {
AfterSDR bool `db:"after_sdr"`
StartedSDR bool `db:"started_sdr"`

TaskTreeD *int64 `db:"task_id_tree_d"`
AfterTreeD bool `db:"after_tree_d"`
StartedTreeD bool `db:"started_tree_d"`
TaskTreeD *int64 `db:"task_id_tree_d"`
AfterTreeD bool `db:"after_tree_d"`
StartedTreeD bool `db:"started_tree_d"`
TreeD *string `db:"tree_d_cid"`

TaskTreeC *int64 `db:"task_id_tree_c"`
AfterTreeC bool `db:"after_tree_c"`
StartedTreeRC bool `db:"started_tree_rc"`

TaskTreeR *int64 `db:"task_id_tree_r"`
AfterTreeR bool `db:"after_tree_r"`
TaskTreeR *int64 `db:"task_id_tree_r"`
AfterTreeR bool `db:"after_tree_r"`
TreeR *string `db:"tree_r_cid"`

TaskSynthetic *int64 `db:"task_id_synth"`
AfterSynthetic bool `db:"after_synth"`
Expand All @@ -47,8 +49,9 @@ type PipelineTask struct {
AfterPrecommitMsg bool `db:"after_precommit_msg"`
StartedPrecommitMsg bool `db:"started_precommit_msg"`

AfterPrecommitMsgSuccess bool `db:"after_precommit_msg_success"`
SeedEpoch *int64 `db:"seed_epoch"`
AfterPrecommitMsgSuccess bool `db:"after_precommit_msg_success"`
PreCommitMsgCid *string `db:"precommit_msg_cid"`
SeedEpoch *int64 `db:"seed_epoch"`

TaskPoRep *int64 `db:"task_id_porep"`
PoRepProof []byte `db:"porep_proof"`
Expand All @@ -69,7 +72,8 @@ type PipelineTask struct {
AfterCommitMsg bool `db:"after_commit_msg"`
StartedCommitMsg bool `db:"started_commit_msg"`

AfterCommitMsgSuccess bool `db:"after_commit_msg_success"`
AfterCommitMsgSuccess bool `db:"after_commit_msg_success"`
CommitMsgCid *string `db:"commit_msg_cid"`

Failed bool `db:"failed"`
FailedReason string `db:"failed_reason"`
Expand Down
Loading
Loading