Skip to content
Open
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
5 changes: 2 additions & 3 deletions cmd/curio/tasks/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ func StartTasks(ctx context.Context, dependencies *deps.Deps, shutdownChan chan
es := getSenderEth()
sdeps.EthSender = es

pdp.NewWatcherCreate(db, must.One(dependencies.EthClient.Val()), chainSched)
pdp.NewWatcherPieceAdd(db, must.One(dependencies.EthClient.Val()), chainSched)
pdp.NewProofSetWatch(db, must.One(dependencies.EthClient.Val()), chainSched)

pdpProveTask := pdp.NewProveTask(chainSched, db, must.One(dependencies.EthClient.Val()), dependencies.Chain, es, dependencies.CachedPieceReader)
pdpNextProvingPeriodTask := pdp.NewNextProvingPeriodTask(db, must.One(dependencies.EthClient.Val()), dependencies.Chain, chainSched, es)
Expand Down Expand Up @@ -512,7 +511,7 @@ func machineDetails(deps *deps.Deps, activeTasks []harmonytask.TaskInterface, ma
})
sort.Strings(miners)

_, err := deps.DB.Exec(context.Background(), `INSERT INTO harmony_machine_details
_, err := deps.DB.Exec(context.Background(), `INSERT INTO harmony_machine_details
(tasks, layers, startup_time, miners, machine_id, machine_name) VALUES ($1, $2, $3, $4, $5, $6)
ON CONFLICT (machine_id) DO UPDATE SET tasks=$1, layers=$2, startup_time=$3, miners=$4, machine_id=$5, machine_name=$6`,
strings.Join(taskNames, ","), strings.Join(deps.Layers, ","),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- Changes the data_set column to be nullable in the pdp_data_set_piece_adds table to faciliate create-and-add workflow.
-- Combined migration: make `data_set` nullable and adjust PK
-- New primary key: (add_message_hash HASH, add_message_index ASC)
-- Old primary key: (data_set HASH, add_message_hash ASC, add_message_index ASC)

DO $$
BEGIN
-- Step 1: Drop existing PK if it still uses data_set
IF EXISTS (
SELECT 1
FROM pg_constraint
WHERE conname = 'pdp_data_set_piece_adds_pk'
AND conrelid = 'pdp_data_set_piece_adds'::regclass
) THEN
ALTER TABLE pdp_data_set_piece_adds
DROP CONSTRAINT pdp_data_set_piece_adds_pk;
END IF;

-- Step 2: Create new PK with add_message_hash as HASH key
ALTER TABLE pdp_data_set_piece_adds
ADD CONSTRAINT pdp_data_set_piece_adds_pk
PRIMARY KEY (add_message_hash HASH, add_message_index ASC);

-- Step 3: Make `data_set` nullable if it is currently NOT NULL
IF EXISTS (
SELECT 1
FROM information_schema.columns
WHERE table_name = 'pdp_data_set_piece_adds'
AND column_name = 'data_set'
AND is_nullable = 'NO'
) THEN
ALTER TABLE pdp_data_set_piece_adds
ALTER COLUMN data_set DROP NOT NULL;
END IF;
END $$;
210 changes: 99 additions & 111 deletions pdp/contract/PDPVerifier.abi
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@
"inputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "BURN_ACTOR",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "EXTRA_DATA_MAX_SIZE",
Expand All @@ -30,32 +17,6 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "FIL_USD_PRICE_FEED_ID",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "LEAF_SIZE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "MAX_ENQUEUED_REMOVALS",
Expand Down Expand Up @@ -108,45 +69,6 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "PYTH",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract IPyth"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "RANDOMNESS_PRECOMPILE",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "SECONDS_IN_DAY",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "UPGRADE_INTERFACE_VERSION",
Expand Down Expand Up @@ -182,6 +104,11 @@
"type": "uint256",
"internalType": "uint256"
},
{
"name": "listenerAddr",
"type": "address",
"internalType": "address"
},
{
"name": "pieceData",
"type": "tuple[]",
Expand All @@ -207,7 +134,7 @@
"internalType": "uint256"
}
],
"stateMutability": "nonpayable"
"stateMutability": "payable"
},
{
"type": "function",
Expand All @@ -217,9 +144,23 @@
"name": "setId",
"type": "uint256",
"internalType": "uint256"
},
}
],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "calculateProofFeeForSize",
"inputs": [
{
"name": "estimatedGasFee",
"name": "rawSize",
"type": "uint256",
"internalType": "uint256"
}
Expand Down Expand Up @@ -312,6 +253,32 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "feeEffectiveTime",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "feePerTiB",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint96",
"internalType": "uint96"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "findPieceIds",
Expand Down Expand Up @@ -531,24 +498,6 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getFILUSDPrice",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint64",
"internalType": "uint64"
},
{
"name": "",
"type": "int32",
"internalType": "int32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "getNextChallengeEpoch",
Expand Down Expand Up @@ -815,6 +764,19 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "proposedFeePerTiB",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint96",
"internalType": "uint96"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "provePossession",
Expand Down Expand Up @@ -901,6 +863,19 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "updateProofFee",
"inputs": [
{
"name": "newFeePerTiB",
"type": "uint256",
"internalType": "uint256"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "upgradeToAndCall",
Expand Down Expand Up @@ -989,6 +964,31 @@
],
"anonymous": false
},
{
"type": "event",
"name": "FeeUpdateProposed",
"inputs": [
{
"name": "currentFee",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "newFee",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "effectiveTime",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Initialized",
Expand Down Expand Up @@ -1143,18 +1143,6 @@
"type": "uint256",
"indexed": false,
"internalType": "uint256"
},
{
"name": "price",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
},
{
"name": "expo",
"type": "int32",
"indexed": false,
"internalType": "int32"
}
],
"anonymous": false
Expand Down
545 changes: 303 additions & 242 deletions pdp/contract/PDPVerifier.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pdp/contract/PDPVerifier.json

This file was deleted.

Loading