Commit Graph

1444 Commits

Author SHA1 Message Date
Aayush Rajasekaran
018c4e8a38
feat: cli: sort actor CIDs alphabetically before printing (#11345) 2023-10-24 10:03:03 -07:00
Łukasz Magiera
99990504b5
Merge pull request #11263 from Icarus9913/libp2p/remove-deprecated-method
fix: deps: stop using go-libp2p deprecated peer.ID.Pretty
2023-09-22 13:59:18 +02:00
Phi-rjan
f7c254b3de
Update cli/wallet.go
Co-authored-by: Łukasz Magiera <magik6k@users.noreply.github.com>
2023-09-20 11:17:57 +02:00
Phi
7e40f8636b Wrap error in wallet sign if msig
Wrap error when a msig is trying to sign a msg, explaining that msigs needs to propose & approve.
2023-09-19 10:57:35 +02:00
Friðrik Ásmundsson
26b35b7f8e
feat: Add ETA to lotus sync wait (#11211) 2023-09-15 10:29:27 -07:00
Icarus9913
2a8ea957fa stop using go-libp2p deprecated peer.ID.Pretty
Signed-off-by: Icarus9913 <icaruswu66@qq.com>
2023-09-12 13:13:34 +08:00
Phi
5edc7dcdb3 Consider SIGTERM as well
Consider SIGTERM as well
2023-08-21 10:37:42 +02:00
Phi
c1fd48a14b Make lotus wallet import respect sigint
Make `lotus wallet import` respect sigint
2023-08-21 09:10:47 +02:00
Phi
3cec54f774 Make TestWalletBalance happy
Set up an expected call to ChainHead
2023-08-09 21:25:52 +02:00
Phi
18ae6bd18b Unify IsSyncDone
Unify IsSyncDone in cli/sync.go and cli/wallet.go
2023-08-09 17:13:25 +02:00
Phi
826ef40626 Only display chain sync in progress if behind sync
Only display `chain sync in progress` if behind sync
2023-08-08 10:06:19 +02:00
beck
2cf19d41af not display privatekey 2023-06-28 03:29:58 +08:00
Friðrik Ásmundsson
a2431ff70a
Merge pull request #10815 from filecoin-project/10814-eip-1891
Add EIP-1898 support needed for The Graph compatibility
2023-06-23 08:29:45 +00:00
Fridrik Asmundsson
dda2d7e023 Refactor EthBlockNumberOrHash and remove the number field 2023-06-22 17:18:50 +00:00
Fridrik Asmundsson
f358160cd5 Add EIP-1898 support needed for The Graph compatibility
Fixes: #10814

This PR updates the following RPC methods according to EIP-1898
specs.

The following RPC methods are affected:

- eth_getBalance
- eth_getStorageAt
- eth_getTransactionCount
- eth_getCode
- eth_call

Note that eth_getBlockByNumber was not included in this list in
the spec although it seems it should be affected also?

Currently these methods all accept a blkParam string which can be
one of "latest", "earliest", "pending", or a block number (decimal
or hex). The spec enables caller to additionally specify a json
hash which can include the following fields:

- blockNumber EthUint64: A block number (decimal or hex) which is
  similar to the original use of the blkParam string
- blockHash EthHash: The block hash
- requireCanonical bool) If true we should make sure the block is
  in the canonical chain

Since the blkParam needs to support both being a number/string and
a json hash then this to properly work we need to introduce a new
struct with pointer fields to check if they exist. This is done
in the EthBlockParamByNumberOrHash struct which first tries to
unmarshal as a json hash (according to eip-1898) and then fallback
to unmarshal as string/number.
2023-06-20 09:38:00 +00:00
Jorropo
6c01310728
chore: migrate to boxo
This migrates everything except the `go-car` librairy: https://github.com/ipfs/boxo/issues/218#issuecomment-1529922103

I didn't migrated everything in the previous release because all the boxo code wasn't compatible with the go-ipld-prime one due to a an in flight (/ aftermath) revert of github.com/ipfs/go-block-format. go-block-format has been unmigrated since slight bellow absolutely everything depends on it that would have required everything to be moved on boxo or everything to optin into using boxo which were all deal breakers for different groups.

This worked fine because lotus's codebase could live hapely on the first multirepo setup however boost is now trying to use boxo's code with lotus's (still on multirepo) setup: https://filecoinproject.slack.com/archives/C03AQ3QAUG1/p1685022344779649

The alternative would be for boost to write shim types which just forward calls and return with the different interface definitions.

Btw why is that an issue in the first place is because unlike what go's duck typing model suggest interfaces are not transparent https://github.com/golang/go/issues/58112, interfaces are strongly typed but they have implicit narrowing. The issue is if you return an interface from an interface Go does not have a function definition to insert the implicit conversion thus instead the type checker complains you are not returning the right type.

Stubbing types were reverted https://github.com/ipfs/boxo/issues/218#issuecomment-1478650351

Last time I only migrated `go-bitswap` to `boxo/bitswap` because of the security issues and because we never had the interface return an interface problem (we had concrete wrappers where the implicit conversion took place).
2023-06-19 14:45:05 -07:00
Steven Allen
dfd3b10182 feat: cli(compute-state) default to the tipset at the given epoch
Previously, we'd use the current head if not otherwise specified, even
when the user specified a epoch. Now:

1. If the user specifies nothing, we use head head's epoch.
2. If the user specifies a tipset and no epoch, we use that tipset and
the epoch of that tipset.
3. If the user specifies an epoch and no tipset, use the tipset at that
epoch (based on the current head).
4. Finally, if the user species both, use both (allowing the
epoch/tipset to disagree).
2023-06-08 13:53:17 -05:00
Łukasz Magiera
6b4a46d273
Merge pull request #10893 from simlecode/opt/output-events-root
opt: cli: If present, print Events Root
2023-05-23 11:50:21 +02:00
Phi
40e51baadc Add alerts to Lotus info cmd
Add alerts to `Lotus info` cmd
2023-05-19 14:31:40 +02:00
simlecode
3207c69528 opt: cli: If present, print Events Root 2023-05-19 16:56:11 +08:00
Marten Seemann
ca9c873858 return all the public addresses in NatInfo 2023-05-10 11:54:48 +03:00
Marten Seemann
b414124e5e chore: update go-libp2p to v0.27.1 2023-05-10 11:54:47 +03:00
Phi
7b72968968 Update args
Update args
2023-05-03 19:37:08 +02:00
Phi
034888c58e Changing to if args.present
Changing to if args.present
2023-05-03 19:03:54 +02:00
Phi
f094e61b4a Remove args check
Remove args check in `lotus chain set`
2023-05-03 17:56:34 +02:00
Łukasz Magiera
07dcc08ecb fix: make state compute --html work with unknown methods 2023-04-04 14:39:01 +02:00
Łukasz Magiera
edae783cf4 fix: cli: Make net connect to miner address work 2023-03-30 09:50:06 +02:00
Aayush
66fc6dc3e5 refactor: stop using deprecated io/ioutil 2023-03-29 15:40:49 -04:00
Łukasz Magiera
7e414ac390 Merge remote-tracking branch 'origin/master' into feat/go-data-transfer-v2 2023-03-15 11:37:53 +01:00
Steven Allen
7a2eb86dd5 feat: cli: Add an EVM command to fetch a contract's bytecode 2023-03-10 10:52:13 -08:00
Steven Allen
58900a7033
feat: mempool: Reduce minimum replace fee from 1.25x to 1.1x (#10416)
However, we're leaving the default at 1.25x for backwards compatibility, for now.

Also:

1. Actually use the configured replace fee ratio.
2. Store said ratios as percentages instead of floats. 1.25, or 1+1/(2^2),
can be represented as a float. 1.1, or 1 + 1/(2 * 5), cannot.

fixes #10415
2023-03-09 13:17:17 -08:00
hannahhoward
16dad6342c
feat(deps): update to go-data-transfer v2, still wip 2023-03-07 11:44:29 -08:00
zenground0
a2d331536b Timing info and updated docs 2023-03-06 12:05:04 -07:00
zenground0
5534755f2d Add command to trigger moving GC of hotstore manually 2023-03-06 11:59:08 -07:00
zenground0
71b21db0d9 chain prune hot -- hotstore online gc 2023-03-03 11:14:52 -05:00
Steven Allen
dbbcf4b2ee
feat: vm: switch to the new exec trace format (#10372)
This is now "FVM" native. Changes include:

1. Don't treat "trace" messages like off-chain messages. E.g., don't
include CIDs, versions, etc.
2. Include IPLD codecs where applicable.
3. Remove fields that aren't filled by the FVM (timing, some errors,
code locations, etc.).
2023-03-01 16:02:18 -08:00
Aayush
19f1ad2762 Merge branch 'releases' into asr/merge-release-into-master 2023-03-01 14:18:35 -05:00
Steven Allen
68b401a895 fix: cli: better handle sending from EthAccount actors
This will make `lotus send` mostly just "do what the user wants" in this
case:

1. The user may not explicitly specify a method number.
2. Parameters are automatically cbor-encoded where applicable.
3. The method number is automatically selected based on the
   recipient (CreateExternal if sent to the EAM, InvokeEVM otherwise).
2023-02-24 15:15:41 -08:00
Łukasz Magiera
ea57a1aec3 Merge remote-tracking branch 'origin/master' into hsanjuan/chain-export-range-rebased 2023-02-23 13:08:14 +01:00
Aayush
984b4c78cb Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-17 16:08:22 -05:00
Jennifer Wang
59db4eeacd fix gen 2023-02-17 00:21:29 -05:00
Jennifer Wang
f2648adee8 fix import 2023-02-17 00:11:07 -05:00
Jennifer Wang
ccdb447085 avoid actor not found 2023-02-17 00:05:07 -05:00
Hector Sanjuan
a2475bca94 range-export: write files to lotus repo path 2023-02-14 21:08:10 +01:00
Hector Sanjuan
be1614a042 range-export: check serverside that head > tail 2023-02-14 21:08:10 +01:00
Hector Sanjuan
ec01036871 Ranged export: remove non-internal ranged export method
Additionally, per feedback:

* Set "admin" permissions
* Remove from v0api
2023-02-14 21:08:10 +01:00
Hector Sanjuan
1bb698619c Ranged-export: Remove CachingBlockstore
The improvements in the range-export code lead to avoid reading most blocks
twice, as well as to allowing some blocks to be written to disk multiple times.

The cache hit-rate went down from being close to 50% to a maximum of 12% at
the very end of the export. The reason is that most CIDs are never read twice
since they are correctly tracked in the CID set.

These numbers do not support the maintenance of the CachingBlockstore
code. Additional testing shows that removing it has similar memory-usage
behaviour and about 5 minute-faster execution (around 10%).

Less code to maintain and less options to mess up with.
2023-02-14 21:08:10 +01:00
Hector Sanjuan
fa93c23813 Chain ranged export: rework and address current shortcomings
This commit moderately refactors the ranged export code. It addresses several
problems:
  * Code does not finish cleanly and things hang on ctrl-c
  * Same block is read multiple times in a row (artificially increasing cached
    blockstore metrics to 50%)
  * It is unclear whether there are additional races (a single worker quits
    when reaching height 0)
  * CARs produced have duplicated blocks (~400k for an 80M-blocks CAR or
    so). Some blocks appear up to 5 times.
  * Using pointers for tasks where it is not necessary.

The changes:

  * Use a FIFO instead of stack: simpler implementation as its own type. This
has not proven to be much more memory-friendly, but it has not made things
worse either.
  * We avoid a probably not small amount of allocations by not using
    unnecessary pointers.
  * Fix duplicated blocks by atomically checking+adding to CID set.
  * Context-termination now works correctly. Worker lifetime is correctly tracked and all channels
  are closed, avoiding any memory leaks and deadlocks.
  * We ensure all work is finished before finishing, something that might have
  been broken in some edge cases previously. In practice, we would not have
  seen this except perhaps in very early snapshots close to genesis.

Initial testing shows the code is currently about 5% faster. Resulting
snapshots do not have duplicates so they are a bit smaller. We have manually
verified that no CID is lost versus previous results, with both old and recent
snapshots.
2023-02-14 21:08:10 +01:00
frrist
21efd481d8 First efficient ranged-export implementation by @frisst
This first commit contains the first and second implementation stabs (after
primary review by @hsanjuan), using a stack for task buffering.

Known issues: ctrl-c (context cancellation) results in the export code getting
deadlocked. Duplicate blocks in exports. Duplicate block reads from store.

Original commit messages:

works

works against mainnet and calibnet

feat: add internal export api method

- will hopfully make things faster by not streaming the export over the json rpc api

polish: better file nameing

fix: potential race in marking cids as seen

chore: improve logging

feat: front export with cache

fix: give hector a good channel buffer on this shit

docsgen
2023-02-14 15:41:10 +01:00
Aayush
63b03a48d0 Merge branch 'release/v1.20.0' into asr/merge-release-into-master 2023-02-10 18:39:51 -05:00