Skip to content

Commit

Permalink
f3 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Oct 21, 2024
1 parent ba74e00 commit 0b8a260
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deps/apiinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

"github.com/filecoin-project/curio/api"

lapi "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
cliutil "github.com/filecoin-project/lotus/cli/util"
)
Expand Down Expand Up @@ -96,7 +97,7 @@ var RPCErrors = jsonrpc.NewErrors()
func newChainNodeRPCV1(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.Chain, jsonrpc.ClientCloser, error) {
var res api.ChainStruct
closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin",
api.GetInternalStructs(&res), requestHeader, append([]jsonrpc.Option{jsonrpc.WithErrors(RPCErrors)}, opts...)...)
api.GetInternalStructs(&res), requestHeader, append([]jsonrpc.Option{jsonrpc.WithErrors(lapi.RPCErrors)}, opts...)...)

return &res, closer, err
}
Expand Down
8 changes: 7 additions & 1 deletion tasks/f3/f3_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,14 @@ func (f *F3Task) TypeDetails() harmonytask.TaskTypeDetails {

func (f *F3Task) Adder(taskFunc harmonytask.AddTaskFunc) {
for minerAddress := range f.actors {
mid, err := address.IDFromAddress(address.Address(minerAddress))
if err != nil {
log.Errorw("failed to parse miner address", "miner", minerAddress, "error", err)
continue
}

taskFunc(func(id harmonytask.TaskID, tx *harmonydb.Tx) (shouldCommit bool, seriousError error) {
n, err := tx.Exec("INSERT INTO f3_tasks (sp_id, task_id) VALUES ($1, $2) ON CONFLICT DO NOTHING", minerAddress, id)
n, err := tx.Exec("INSERT INTO f3_tasks (sp_id, task_id) VALUES ($1, $2) ON CONFLICT DO NOTHING", mid, id)
if err != nil {
return false, err
}
Expand Down

0 comments on commit 0b8a260

Please sign in to comment.