Skip to content

Commit

Permalink
F3 WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Kubuxu committed Jun 19, 2024
1 parent 6f821c3 commit 5861704
Show file tree
Hide file tree
Showing 8 changed files with 308 additions and 18 deletions.
161 changes: 161 additions & 0 deletions chain/lf3/ec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
package lf3

import (
"context"
"sort"
"time"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-f3"

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Build

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-fevm)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-fevm)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Check (gen-check)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-deadlines)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-deadlines)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-migration)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_block_hash)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_block_hash)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-splitstore)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-splitstore)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-rest)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-rest)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_terminate)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_terminate)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_terminate)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_dispute)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_dispute)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_legacy_transactions)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_legacy_transactions)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-paych_api)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-paych_api)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_filter)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_filter)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_config)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_config)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_no_miner_storage)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_no_miner_storage)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-supply)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-supply)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-cli)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-cli)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_worker_config)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost_worker_config)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sealing_resources)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sealing_resources)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_unseal)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_hash_lookup)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_hash_lookup)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-direct_data_onboard_verified)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-direct_data_onboard_verified)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-harmonydb)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-harmonydb)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-api)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-api)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-direct_data_onboard)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-direct_data_onboard)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-gateway)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-gateway)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_pledge)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_pledge)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-worker)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-worker)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_import_full)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_import_full)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_import_simple)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_import_simple)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-deals_invalid_utf8_label)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-deals_invalid_utf8_label)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-dup_mpool_messages)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-dup_mpool_messages)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-wdpost)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_account_abstraction)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_account_abstraction)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_api)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_api)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_config)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_config)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_bytecode)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_conformance)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_conformance)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_balance)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_balance)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_deploy)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_deploy)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_fee_history)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_fee_history)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_transactions)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-eth_transactions)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-gas_estimation)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-gas_estimation)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-fevm_events)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-fevm_events)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-get_messages_in_ts)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-get_messages_in_ts)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-lite_migration)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-lite_migration)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-fevm_address)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-fevm_address)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-mempool)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-mempool)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-lookup_robust_address)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-lookup_robust_address)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-mpool_msg_uuid)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-mpool_msg_uuid)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-mpool_push_with_uuid)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-mpool_push_with_uuid)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-manual_onboarding)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-manual_onboarding)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-msgindex)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-msgindex)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-multisig)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-multisig)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-nonce)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-nonce)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-pending_deal_allocation)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-pending_deal_allocation)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-remove_verifreg_datacap)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-remove_verifreg_datacap)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-net)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-net)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_miner_collateral)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_miner_collateral)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_numassign)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-sector_numassign)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-path_detach_redeclare)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-path_detach_redeclare)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-self_sent_txn)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-self_sent_txn)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-verifreg)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (itest-verifreg)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-node)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 9 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-node)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist
"github.com/filecoin-project/go-f3/gpbft"

Check failure on line 10 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-rest)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 10 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-rest)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 10 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-node)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 10 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Test (unit-node)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
"golang.org/x/xerrors"
)

type ecWrapper struct {
ChainStore *store.ChainStore
StateManager *stmgr.StateManager
Manifest f3.Manifest

Check failure on line 23 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Check (lint-all)

undefined: f3 (typecheck)
}

type tsWrapper struct {
inner *types.TipSet
}

func (ts *tsWrapper) Key() gpbft.TipSetKey {
return ts.inner.Key().Bytes()
}

func (ts *tsWrapper) Beacon() []byte {
// TOOD: verify if correct
return ts.inner.MinTicket().VRFProof
}

func (ts *tsWrapper) Epoch() int64 {
return int64(ts.inner.Height())
}

func (ts *tsWrapper) Timestamp() time.Time {
return time.Unix(int64(ts.inner.Blocks()[0].Timestamp), 0)
}

func wrapTS(ts *types.TipSet) f3.TipSet {

Check failure on line 47 in chain/lf3/ec.go

View workflow job for this annotation

GitHub Actions / Check (lint-all)

undefined: f3 (typecheck)
if ts == nil {
return nil
}
return &tsWrapper{ts}
}

// GetTipsetByEpoch should return a tipset before the one requested if the requested
// tipset does not exist due to null epochs
func (ec *ecWrapper) GetTipsetByEpoch(ctx context.Context, epoch int64) (f3.TipSet, error) {
ts, err := ec.ChainStore.GetTipsetByHeight(ctx, abi.ChainEpoch(epoch), nil, true)
if err != nil {
return nil, xerrors.Errorf("getting tipset by height: %w", err)
}
return wrapTS(ts), nil
}

func (ec *ecWrapper) GetTipset(ctx context.Context, tsk gpbft.TipSetKey) (f3.TipSet, error) {
tskLotus, err := types.TipSetKeyFromBytes([]byte(tsk))
if err != nil {
return nil, xerrors.Errorf("decoding tsk: %w", err)
}

ts, err := ec.ChainStore.GetTipSetFromKey(ctx, tskLotus)
if err != nil {
return nil, xerrors.Errorf("getting tipset by key: %w", err)
}

return wrapTS(ts), nil
}

func (ec *ecWrapper) GetHead(_ context.Context) (f3.TipSet, error) {
return wrapTS(ec.ChainStore.GetHeaviestTipSet()), nil
}

func (ec *ecWrapper) GetParent(ctx context.Context, tsF3 f3.TipSet) (f3.TipSet, error) {
var ts *types.TipSet
if tsW, ok := tsF3.(*tsWrapper); ok {
ts = tsW.inner
} else {
tskLotus, err := types.TipSetKeyFromBytes([]byte(tsF3.Key()))
if err != nil {
return nil, xerrors.Errorf("decoding tsk: %w", err)
}
ts, err = ec.ChainStore.GetTipSetFromKey(ctx, tskLotus)
if err != nil {
return nil, xerrors.Errorf("getting tipset by key for get parent: %w", err)
}
}
parentTs, err := ec.ChainStore.GetTipSetFromKey(ctx, ts.Parents())
if err != nil {
return nil, xerrors.Errorf("getting parent tipset: %w", err)
}
return wrapTS(parentTs), nil
}

func (ec *ecWrapper) GetPowerTable(ctx context.Context, tskF3 gpbft.TipSetKey) (gpbft.PowerEntries, error) {
tskLotus, err := types.TipSetKeyFromBytes([]byte(tskF3))
if err != nil {
return nil, xerrors.Errorf("decoding tsk: %w", err)
}
ts, err := ec.ChainStore.GetTipSetFromKey(ctx, tskLotus)
if err != nil {
return nil, xerrors.Errorf("getting tipset by key for get parent: %w", err)
}
log.Infof("collecting power table for: %d", ts.Height())
stCid := ts.ParentState()

sm := ec.StateManager

powerAct, err := sm.LoadActor(ctx, power.Address, ts)
powerState, err := power.Load(ec.ChainStore.ActorStore(ctx), powerAct)

var powerEntries gpbft.PowerEntries
err = powerState.ForEachClaim(func(miner address.Address, claim power.Claim) error {
if claim.QualityAdjPower.LessThanEqual(big.Zero()) {
return nil
}

// TODO: optimize
ok, err := powerState.MinerNominalPowerMeetsConsensusMinimum(miner)
if err != nil {
return xerrors.Errorf("checking consensus minimums: %w", err)
}
if !ok {
return nil
}

id, err := address.IDFromAddress(miner)
if err != nil {
return xerrors.Errorf("transforming address to ID: %w", err)
}

pe := gpbft.PowerEntry{
ID: gpbft.ActorID(id),
Power: claim.QualityAdjPower.Int,
}
waddr, err := stmgr.GetMinerWorkerRaw(ctx, sm, stCid, miner)
if err != nil {
return xerrors.Errorf("GetMinerWorkerRaw failed: %w", err)
}
if waddr.Protocol() != address.BLS {
return xerrors.Errorf("wrong type of worker address")
}
pe.PubKey = gpbft.PubKey(waddr.Payload())
powerEntries = append(powerEntries, pe)
return nil
})
if err != nil {
return nil, xerrors.Errorf("collecting the power table: %w", err)
}

sort.Sort(powerEntries)
return powerEntries, nil
}
82 changes: 82 additions & 0 deletions chain/lf3/f3.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package lf3

import (
"context"
"time"

"github.com/filecoin-project/go-f3"
"github.com/filecoin-project/go-f3/blssig"

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Build

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Check (gen-check)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Test (unit-rest)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Test (unit-rest)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Test (unit-cli)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Test (unit-cli)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Test (unit-node)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist

Check failure on line 8 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Test (unit-node)

github.com/filecoin-project/[email protected]: replacement directory ../go-f3 does not exist
"github.com/filecoin-project/go-f3/gpbft"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/namespace"
logging "github.com/ipfs/go-log/v2"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/host"
"go.uber.org/fx"
"golang.org/x/xerrors"
)

type F3 struct {
f3 *f3.F3

Check failure on line 25 in chain/lf3/f3.go

View workflow job for this annotation

GitHub Actions / Check (lint-all)

undefined: f3 (typecheck)
}

type F3Params struct {
fx.In

NetworkName dtypes.NetworkName
PubSub *pubsub.PubSub
Host host.Host
ChainStore *store.ChainStore
StateManager *stmgr.StateManager
Datastore dtypes.MetadataDS
Wallet api.Wallet
}

var log = logging.Logger("f3")

func New(lc fx.Lifecycle, params F3Params) (*F3, error) {
logging.SetLogLevel("f3", "DEBUG")
manifest := f3.LocalnetManifest()
manifest.NetworkName = gpbft.NetworkName(params.NetworkName)
manifest.ECDelay = time.Duration(build.BlockDelaySecs) * time.Second
manifest.ECPeriod = manifest.ECDelay
manifest.BootstrapEpoch = 210
manifest.ECFinality = 200
ds := namespace.Wrap(params.Datastore, datastore.NewKey("/f3"))
ec := &ecWrapper{
ChainStore: params.ChainStore,
StateManager: params.StateManager,
Manifest: manifest,
}
verif := blssig.VerifierWithKeyOnG1()
module, err := f3.New(context.TODO(), 1000 /*TODO expose signing*/, manifest, ds,
params.Host, params.PubSub, &signer{params.Wallet}, verif, ec, log)

if err != nil {
return nil, xerrors.Errorf("creating F3: %w", err)
}

var liftimeContext context.Context
var cancel func()
lc.Append(fx.StartStopHook(
func(ctx context.Context) {
liftimeContext, cancel = context.WithCancel(ctx)
go func() {
err := module.Run(0, liftimeContext)
if err != nil {
log.Errorf("running f3: %+v", err)
}
}()
}, func() {
cancel()
}))

return &F3{
f3: module,
}, nil
}
35 changes: 35 additions & 0 deletions chain/lf3/signer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package lf3

import (
"context"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-f3/gpbft"
"github.com/filecoin-project/lotus/api"
"golang.org/x/xerrors"
)

type signer struct {
wallet api.Wallet
}

// Signs a message with the secret key corresponding to a public key.
func (s *signer) Sign(sender gpbft.PubKey, msg []byte) ([]byte, error) {
addr, err := address.NewBLSAddress(sender)
if err != nil {
return nil, xerrors.Errorf("converting pubkey to address: %w", err)
}
sig, err := s.wallet.WalletSign(context.TODO(), addr, msg, api.MsgMeta{Type: api.MTUnknown})
if err != nil {
return nil, xerrors.Errorf("error while signing: %w", err)
}
return sig.Data, nil
}

// MarshalPayloadForSigning marshals the given payload into the bytes that should be signed.
// This should usually call `Payload.MarshalForSigning(NetworkName)` except when testing as
// that method is slow (computes a merkle tree that's necessary for testing).
// Implementations must be safe for concurrent use.
func (s *signer) MarshalPayloadForSigning(nn gpbft.NetworkName, p *gpbft.Payload) []byte {
return p.MarshalForSigning(nn)
}
16 changes: 10 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ replace github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi // pro

replace github.com/filecoin-project/test-vectors => ./extern/test-vectors // provided via a git submodule

replace github.com/filecoin-project/go-f3 => ../go-f3

require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
github.com/BurntSushi/toml v1.3.0
github.com/BurntSushi/toml v1.3.2
github.com/DataDog/zstd v1.4.5
github.com/GeertJohan/go.rice v1.0.3
github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee
Expand All @@ -26,7 +28,7 @@ require (
github.com/dgraph-io/badger/v2 v2.2007.4
github.com/docker/go-units v0.5.0
github.com/drand/drand v1.5.11
github.com/drand/kyber v1.3.0
github.com/drand/kyber v1.3.1
github.com/dustin/go-humanize v1.0.1
github.com/elastic/go-elasticsearch/v7 v7.14.0
github.com/elastic/go-sysinfo v1.7.0
Expand All @@ -41,6 +43,7 @@ require (
github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837
github.com/filecoin-project/go-crypto v0.0.1
github.com/filecoin-project/go-f3 v0.0.0-20240619112353-e4ef2ea3078f
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0
github.com/filecoin-project/go-jsonrpc v0.3.2
Expand Down Expand Up @@ -102,7 +105,7 @@ require (
github.com/klauspost/compress v1.17.8
github.com/koalacxr/quantile v0.0.1
github.com/libp2p/go-buffer-pool v0.1.0
github.com/libp2p/go-libp2p v0.34.1
github.com/libp2p/go-libp2p v0.35.0
github.com/libp2p/go-libp2p-kad-dht v0.25.2
github.com/libp2p/go-libp2p-pubsub v0.11.0
github.com/libp2p/go-libp2p-record v0.2.0
Expand Down Expand Up @@ -130,7 +133,7 @@ require (
github.com/stretchr/testify v1.9.0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/triplewz/poseidon v0.0.0-20230828015038-79d8165c88ed
github.com/urfave/cli/v2 v2.25.5
github.com/urfave/cli/v2 v2.27.2
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba
github.com/whyrusleeping/cbor-gen v0.1.1
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7
Expand Down Expand Up @@ -163,6 +166,7 @@ require (
require (
github.com/GeertJohan/go.incremental v1.0.0 // indirect
github.com/Jorropo/jsync v1.0.1 // indirect
github.com/Kubuxu/go-broadcast v0.0.0-20240212204713-7007a1e29a19 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
Expand All @@ -174,7 +178,7 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cilium/ebpf v0.9.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 // indirect
github.com/cskr/pubsub v1.0.2 // indirect
github.com/daaku/go.zipexe v1.0.2 // indirect
Expand Down Expand Up @@ -311,7 +315,7 @@ require (
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
github.com/zondax/hid v0.9.2 // indirect
github.com/zondax/ledger-go v0.14.3 // indirect
go.opentelemetry.io/otel/metric v1.26.0 // indirect
Expand Down
Loading

0 comments on commit 5861704

Please sign in to comment.