Skip to content

Commit 7fffe6c

Browse files
committed
fix tests
1 parent 3d97434 commit 7fffe6c

File tree

6 files changed

+64
-59
lines changed

6 files changed

+64
-59
lines changed

api/api_chain.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ type CurioChainRPC interface {
9898
StateVerifiedClientStatus(context.Context, address.Address, types.TipSetKey) (*abi.StoragePower, error)
9999
StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error)
100100
StateCirculatingSupply(context.Context, types.TipSetKey) (big.Int, error)
101+
StateCall(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error)
101102
}
102103

103104
var _ CurioChainRPC = api.FullNode(nil)

api/proxy_gen.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/openrpc/curio.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@
312312
"deprecated": false,
313313
"externalDocs": {
314314
"description": "Github remote link",
315-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L311"
315+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L314"
316316
}
317317
},
318318
{
@@ -348,7 +348,7 @@
348348
"deprecated": false,
349349
"externalDocs": {
350350
"description": "Github remote link",
351-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L322"
351+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L325"
352352
}
353353
},
354354
{
@@ -402,7 +402,7 @@
402402
"deprecated": false,
403403
"externalDocs": {
404404
"description": "Github remote link",
405-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L333"
405+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L336"
406406
}
407407
},
408408
{
@@ -425,7 +425,7 @@
425425
"deprecated": false,
426426
"externalDocs": {
427427
"description": "Github remote link",
428-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L344"
428+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L347"
429429
}
430430
},
431431
{
@@ -464,7 +464,7 @@
464464
"deprecated": false,
465465
"externalDocs": {
466466
"description": "Github remote link",
467-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L355"
467+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L358"
468468
}
469469
},
470470
{
@@ -503,7 +503,7 @@
503503
"deprecated": false,
504504
"externalDocs": {
505505
"description": "Github remote link",
506-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L366"
506+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L369"
507507
}
508508
},
509509
{
@@ -697,7 +697,7 @@
697697
"deprecated": false,
698698
"externalDocs": {
699699
"description": "Github remote link",
700-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L377"
700+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L380"
701701
}
702702
},
703703
{
@@ -829,7 +829,7 @@
829829
"deprecated": false,
830830
"externalDocs": {
831831
"description": "Github remote link",
832-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L388"
832+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L391"
833833
}
834834
},
835835
{
@@ -963,7 +963,7 @@
963963
"deprecated": false,
964964
"externalDocs": {
965965
"description": "Github remote link",
966-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L399"
966+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L402"
967967
}
968968
},
969969
{
@@ -1017,7 +1017,7 @@
10171017
"deprecated": false,
10181018
"externalDocs": {
10191019
"description": "Github remote link",
1020-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L410"
1020+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L413"
10211021
}
10221022
},
10231023
{
@@ -1051,7 +1051,7 @@
10511051
"deprecated": false,
10521052
"externalDocs": {
10531053
"description": "Github remote link",
1054-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L421"
1054+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L424"
10551055
}
10561056
},
10571057
{
@@ -1128,7 +1128,7 @@
11281128
"deprecated": false,
11291129
"externalDocs": {
11301130
"description": "Github remote link",
1131-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L432"
1131+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L435"
11321132
}
11331133
},
11341134
{
@@ -1166,7 +1166,7 @@
11661166
"deprecated": false,
11671167
"externalDocs": {
11681168
"description": "Github remote link",
1169-
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L443"
1169+
"url": "https://github.com/filecoin-project/curio/blob/master/api/proxy_gen.go#L446"
11701170
}
11711171
}
11721172
]

deps/config/doc_gen.go

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

documentation/en/configuration/default-curio-configuration.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,21 @@ description: The default curio configuration
409409

410410
[Market]
411411
[Market.DealMarketConfig]
412+
# PieceLocator is a list of HTTP url and headers combination to query for a piece for offline deals
413+
# User can run a remote file server which can host all the pieces over the HTTP and supply a reader when requested.
414+
# The server must have 2 endpoints
415+
# 1. /pieces?id=pieceCID responds with 200 if found or 404 if not. Must send header "Filecoin-Piece-RawSize" with file size as value
416+
# 2. /data?id=pieceCID must provide a reader for the requested piece
417+
#
418+
# type: []PieceLocatorConfig
419+
#PieceLocator = []
420+
412421
[Market.DealMarketConfig.MK12]
422+
# Miners is a list of miner to enable MK12 deals(Boost) for
423+
#
424+
# type: []string
425+
#Miners = []
426+
413427
# When a deal is ready to publish, the amount of time to wait for more
414428
# deals to be ready to publish before publishing them all as a batch
415429
#

harmony/harmonydb/sql/20240730-market-migration.sql

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CREATE TABLE market_mk12_deals (
22
uuid TEXT NOT NULL,
3-
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP AT TIME ZONE 'UTC',
3+
created_at TIMESTAMPTZ NOT NULL DEFAULT TIMEZONE('UTC', NOW()),
44
signed_proposal_cid TEXT NOT NULL,
55
proposal_signature BYTEA NOT NULL,
66
proposal jsonb NOT NULL,
@@ -49,9 +49,9 @@ CREATE TABLE market_legacy_deals (
4949
CREATE TABLE market_piece_metadata (
5050
piece_cid TEXT NOT NULL PRIMARY KEY,
5151
version INT NOT NULL DEFAULT 2,
52-
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP AT TIME ZONE 'UTC',
52+
created_at TIMESTAMPTZ NOT NULL DEFAULT TIMEZONE('UTC', NOW()),
5353
indexed BOOLEAN NOT NULL DEFAULT FALSE,
54-
indexed_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP AT TIME ZONE 'UTC',
54+
indexed_at TIMESTAMPTZ NOT NULL DEFAULT TIMEZONE('UTC', NOW()),
5555

5656
constraint market_piece_meta_identity_key
5757
unique (piece_cid)
@@ -69,7 +69,7 @@ CREATE TABLE market_piece_deal (
6969
piece_length BIGINT NOT NULL,
7070
raw_size BIGINT NOT NULL,
7171

72-
primary key (sp_id, piece_cid, deal),
72+
primary key (sp_id, piece_cid, id),
7373
constraint market_piece_deal_identity_key
7474
unique (sp_id, id)
7575
);
@@ -78,33 +78,26 @@ CREATE OR REPLACE FUNCTION process_piece_deal(
7878
_id TEXT,
7979
_piece_cid TEXT,
8080
_boost_deal BOOLEAN,
81-
_legacy_deal BOOLEAN DEFAULT FALSE,
82-
_chain_deal_id BIGINT DEFAULT 0,
8381
_sp_id BIGINT,
8482
_sector_num BIGINT,
8583
_piece_offset BIGINT,
8684
_piece_length BIGINT,
87-
_raw_size BIGINT
85+
_raw_size BIGINT,
86+
_legacy_deal BOOLEAN DEFAULT FALSE,
87+
_chain_deal_id BIGINT DEFAULT 0
8888
)
8989
RETURNS VOID AS $$
9090
BEGIN
91-
-- Update or insert into market_piece_metadata
92-
INSERT INTO market_piece_metadata (piece_cid, indexed, indexed_at)
93-
VALUES (_piece_cid, TRUE, CURRENT_TIMESTAMP AT TIME ZONE 'UTC')
94-
ON CONFLICT (piece_cid) DO UPDATE
95-
SET indexed = TRUE,
96-
indexed_at = CURRENT_TIMESTAMP AT TIME ZONE 'UTC';
97-
98-
-- Insert into market_piece_deal
91+
INSERT INTO market_piece_metadata (piece_cid, indexed) VALUES (_piece_cid, TRUE)
92+
ON CONFLICT (piece_cid) DO UPDATE SET indexed = TRUE;
93+
9994
INSERT INTO market_piece_deal (
10095
id, piece_cid, boost_deal, legacy_deal, chain_deal_id,
10196
sp_id, sector_num, piece_offset, piece_length, raw_size
102-
)
103-
VALUES (
97+
) VALUES (
10498
_id, _piece_cid, _boost_deal, _legacy_deal, _chain_deal_id,
10599
_sp_id, _sector_num, _piece_offset, _piece_length, _raw_size
106-
)
107-
ON CONFLICT (sp_id, piece_cid, id) DO NOTHING;
100+
) ON CONFLICT (sp_id, piece_cid, id) DO NOTHING;
108101
END;
109102
$$ LANGUAGE plpgsql;
110103

@@ -125,7 +118,7 @@ CREATE TABLE market_mk12_deal_pipeline (
125118
sp_id BIGINT NOT NULL,
126119
started BOOLEAN DEFAULT FALSE,
127120
piece_cid TEXT NOT NULL,
128-
piece_size BOOLEAN NOT NULL,
121+
piece_size BIGINT NOT NULL,
129122
offline BOOLEAN NOT NULL,
130123
downloaded BOOLEAN DEFAULT FALSE,
131124
url TEXT DEFAULT NULL,
@@ -165,39 +158,19 @@ CREATE TABLE market_indexing_tasks (
165158
piece_size BIGINT NOT NULL,
166159
raw_size BIGINT NOT NULL,
167160
piece_cid TEXT NOT NULL,
168-
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP AT TIME ZONE 'UTC',
161+
created_at TIMESTAMPTZ NOT NULL DEFAULT TIMEZONE('UTC', NOW()),
169162
task_id BIGINT DEFAULT NULL,
170163

171164
constraint market_indexing_tasks_identity_key
172165
unique (id, sp_id, sector_number, piece_offset, piece_size, piece_cid, reg_seal_proof)
173-
)
166+
);
174167

175168
CREATE TABLE libp2p_keys (
176169
sp_id BIGINT NOT NULL,
177170
priv_key BYTEA NOT NULL,
178171
listen_address TEXT NOT NULL,
179172
announce_address TEXT NOT NULL,
180-
no_announce_address TEXT NOT NULL,
181-
);
182-
183-
CREATE TABLE direct_deals (
184-
id TEXT,
185-
created_at TIMESTAMPTZ,
186-
piece_cid TEXT,
187-
piece_size BIGINT,
188-
cleanup_data BOOLEAN,
189-
client_address TEXT,
190-
provider_address TEXT,
191-
allocation_id BIGINT,
192-
start_epoch BIGINT,
193-
end_epoch BIGINT,
194-
inbound_file_path TEXT,
195-
inbound_file_size BIGINT,
196-
sector_id BIGINT,
197-
offset BIGINT,
198-
length BIGINT,
199-
announce_to_ipni BOOLEAN,
200-
keep_unsealed_copy BOOLEAN
173+
no_announce_address TEXT NOT NULL
201174
);
202175

203176

0 commit comments

Comments
 (0)