Skip to content

Commit cf0fad6

Browse files
authored
fix pp init in PDPV0 (#661)
1 parent bb6a95a commit cf0fad6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tasks/pdp/task_init_pp.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"errors"
66
"math/big"
7+
"strings"
78

89
"github.com/ethereum/go-ethereum/accounts/abi/bind"
910
"github.com/ethereum/go-ethereum/core/types"
@@ -191,6 +192,8 @@ func (ipp *InitProvingPeriodTask) Do(taskID harmonytask.TaskID, stillOwned func(
191192
return false, xerrors.Errorf("failed to send transaction: %w", err)
192193
}
193194

195+
txHashLower := strings.ToLower(txHash.Hex())
196+
194197
// Update the database in a transaction
195198
_, err = ipp.db.BeginTransaction(ctx, func(tx *harmonydb.Tx) (bool, error) {
196199
// Update pdp_data_sets
@@ -200,7 +203,7 @@ func (ipp *InitProvingPeriodTask) Do(taskID harmonytask.TaskID, stillOwned func(
200203
prev_challenge_request_epoch = $2,
201204
prove_at_epoch = $3
202205
WHERE id = $4
203-
`, txHash.Hex(), ts.Height(), init_prove_at.Uint64(), dataSetId)
206+
`, txHashLower, ts.Height(), init_prove_at.Uint64(), dataSetId)
204207
if err != nil {
205208
return false, xerrors.Errorf("failed to update pdp_data_sets: %w", err)
206209
}
@@ -212,7 +215,7 @@ func (ipp *InitProvingPeriodTask) Do(taskID harmonytask.TaskID, stillOwned func(
212215
_, err = tx.Exec(`
213216
INSERT INTO message_waits_eth (signed_tx_hash, tx_status)
214217
VALUES ($1, 'pending') ON CONFLICT DO NOTHING
215-
`, txHash.Hex())
218+
`, txHashLower)
216219
if err != nil {
217220
return false, xerrors.Errorf("failed to insert into message_waits_eth: %w", err)
218221
}

0 commit comments

Comments
 (0)