Commit Graph

4371 Commits

Author SHA1 Message Date
Aayush
034f6cf832 wip: 2 more randomness fetching APIs 2023-08-21 16:32:27 -04:00
Aayush
e5fbba7958 Refactor: Rand: Return randomness digest to VM 2023-08-21 15:44:49 -04:00
Aayush
98a82d3dfe Refactor: Rand: Rename DrawRandomness to DrawRandomnessFromBase 2023-08-21 15:03:46 -04:00
Aayush
05ac9453cd Refactor: Rand: return randomness base without hashing 2023-08-21 15:03:46 -04:00
Marten Seemann
93f95d2ef9 Revert "stop using deprecated functions from the math/rand package"
This reverts commit d50cf4eb64.
2023-08-21 15:02:06 +07:00
Marten Seemann
d50cf4eb64 stop using deprecated functions from the math/rand package 2023-08-21 13:53:46 +07:00
Marten Seemann
bca0ec4f9c update go-libp2p v0.30.0 2023-08-21 10:44:37 +07:00
Phi
8b5da86727 feat: introduce local nv21 skeleton
Introduce nv21 skeleton for local testing:

- Use local go-state-types with actor_version_checklist changes: https://github.com/filecoin-project/go-state-types/blob/master/actors_version_checklist.md
- Imports mock v12-actors bundle
- Define upgrade heights
- Generate adapters
- Add upgrade schedule and migration
- Add actorstype to the NewActorRegistry in /chain/consensus/computestate.go
- Add upgrade field to api/types.go/ForkUpgradeParams
- Add upgrade to node/impl/full/state.go
- Add network version to chain/state/statetree.go
- make jen
- make docsgen-cli
2023-08-16 20:01:48 +02:00
simlecode
a750e63a7b opt: fix duplicate check exitcode 2023-08-15 16:28:03 +08:00
Aayush
12e076e9ea fix: chainstore: do not get stuck in unhappy equivocation cases 2023-08-11 17:32:39 -04:00
Aayush
20e831b9ea refactor: drop unused param from IsRoundWinner 2023-08-11 09:48:09 -04:00
Aayush
69f3580ca2 add more test cases covering chainstore equivocation 2023-08-09 21:00:50 -04:00
Aayush
2cbdedc209 add more test cases covering chainstore equivocation 2023-08-09 19:40:53 -04:00
Aayush
0ff334912b Address review 2023-08-09 19:28:24 -04:00
Aayush
52657c5cb0 feat: chainstore: FRC-0051: Remove all equivocated blocks from tipsets 2023-08-09 19:28:24 -04:00
Łukasz Magiera
683432e6e0
Merge pull request #11119 from filecoin-project/chore/cleanup-compunscid
chore: legacy syscalls: Cleanup ComputeUnsealedSectorCID
2023-08-02 06:45:35 -07:00
Łukasz Magiera
fbac220208 feat: chain node: Move consensus slasher to internal service 2023-08-01 12:06:18 -04:00
Aayush
a413a53be2 feat: refactor slashfilter to return bool indicating fault 2023-08-01 12:05:02 -04:00
Łukasz Magiera
fe7cf0c39a feat: chain node: Move consensus slasher to internal service 2023-08-01 17:34:44 +02:00
Aayush
4872ad66a7 feat: FVM: do not error on unsuccessful implicit messages 2023-07-31 15:37:54 -04:00
Aayush
cd958e4f6e feat: FVM: do not error on unsuccessful implicit messages 2023-07-31 15:26:37 -04:00
Łukasz Magiera
bf36ca93bb legacy syscalls: Cleanup ComputeUnsealedSectorCID 2023-07-31 12:43:47 +02:00
Aayush
990b5a0bad fix: ethtypes: handle length overflow case 2023-07-21 12:26:29 -04:00
Aayush Rajasekaran
d40946fb8c
Merge pull request #11081 from filecoin-project/steb/bare-cbor
feat: vm: allow raw "cbor" in state and use the new go-multicodec
2023-07-18 12:53:44 -04:00
Aayush
e17af657da chore: stmgr: migrations: do not log noisily on cache misses 2023-07-18 10:22:30 -04:00
Steven Allen
1fc47eb7d8 feat: vm: allow raw "cbor" in state and use the new go-multicodec
1. Switch to go-multicodec as the source of multicodec code information.
This gives us a central, generated source of multicodec codes.
2. Use this library inside the VM and shapshot logic to consistently
allow CBOR, in addition to DagCBOR.
3. Remove the hard-coded CBOR constant.
2023-07-17 11:24:01 -07:00
Aayush
09b566dde1 fix: daemon: set real beacon schedule when importing chain 2023-07-17 09:36:41 -04:00
Fridrik Asmundsson
871d1ba547 fix: DecodeRLP can panic 2023-07-14 11:49:50 +00:00
Łukasz Magiera
2f19a5f66d gen, fix build with new state-types 2023-07-13 15:48:19 +02:00
Andrew Jackson (Ajax)
1a799aec37 fixes 2023-07-13 15:48:08 +02:00
Andrew Jackson (Ajax)
08038540e4 Impl synthPoRep 2023-07-13 15:47:59 +02:00
Andrew Jackson (Ajax)
b43665a3c1 synthPoRep in PreferredSeal..() 2023-07-13 15:47:58 +02:00
Andrew Jackson (Ajax)
1db45f46ae synthetic-porep subpackages 2023-07-13 15:47:20 +02:00
Phi
c7b9633160 feat: introduce local nv21 skeleton
Introduce nv21 skeleton for local testing:

- Use local go-state-types with actor_version_checklist changes: https://github.com/filecoin-project/go-state-types/blob/master/actors_version_checklist.md
- Imports mock v12-actors bundle
- Define upgrade heights
- Generate adapters
- Add upgrade schedule and migration
- Add actorstype to the NewActorRegistry in /chain/consensus/computestate.go
- Add upgrade field to api/types.go/ForkUpgradeParams
- Add upgrade to node/impl/full/state.go
- Add network version to chain/state/statetree.go
- make jen
- make docsgen-cli
2023-07-13 15:47:18 +02:00
Aayush Rajasekaran
807a5dbaa8
Merge pull request #11016 from filecoin-project/sbansal/invert-validation-switch-checks
refactor: Make all validation error actions explicit
2023-07-11 11:31:40 -04:00
Fridrik Asmundsson
655ea1e0b5 Add tmp indices to events table while performing migration to V2
After the migration we also perform db administration on the
events DB to reduce its file size on disk.

(cherry picked from commit 0d7621be56)
2023-07-11 10:25:32 -04:00
Fridrik Asmundsson
0d7621be56 Add tmp indices to events table while performing migration to V2
After the migration we also perform db administration on the
events DB to reduce its file size on disk.
2023-07-11 10:16:47 +00:00
Aayush Rajasekaran
3f71298c4b
Merge pull request #11054 from filecoin-project/asr/max-event-length
feat: types: apply a max length when decoding events
2023-07-10 10:37:30 -04:00
Aayush
802a9f0a78 feat: refactor slashfilter to return bool indicating fault 2023-07-08 11:14:41 -04:00
Aayush
07965467ee feat: fvm: apply a max length when decoding events 2023-07-08 11:05:01 -04:00
Shrenuj Bansal
bc5637c60a keep default action as reject and make all error actions explicit 2023-07-05 12:13:01 -04:00
Fridrik Asmundsson
b80c0828b9 feat: Make sure we dont store duplidate actor events caused by reorgs 2023-06-30 11:20:57 +00:00
Shrenuj Bansal
be3281bdcf Invert msg validation check to explicitly specify reject errors 2023-06-28 13:35:21 -04: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
Aayush Rajasekaran
4ca5b0ede9
Merge pull request #10973 from filecoin-project/asr/fix-existing-nonce
fix: pubsub: do not treat ErrExistingNonce as Reject
2023-06-13 09:25:11 -05:00
Aayush
2a6d0e5f6e fix: pubsub: do not treat ErrExistingNonce as Reject 2023-06-13 10:13:24 -04:00
mx
48912e8f09 fix: chain error 2023-06-13 09:46:36 +08:00
mx
36b5f485cd Merge branch 'slashfilter' of https://github.com/storswiftlabs/lotus into slashfilter 2023-06-09 10:18:45 +08:00
mx
2fca475dd4 fix: supply extra params for ReportConsensusFaultParams 2023-06-09 10:15:14 +08:00
swift-mx
e3c796c848
Merge branch 'master' into slashfilter 2023-06-08 18:56:49 +08:00
Fridrik Asmundsson
9240776237 fix: improve perf of msgindex backfill 2023-06-01 14:36:05 +00:00
swift-mx
2fd8602c5a
Merge branch 'master' into slashfilter 2023-05-31 10:02:01 +08:00
Łukasz Magiera
6cc506f5cf
Merge pull request #10923 from filecoin-project/feat/sectors-upgradebounds-cli
feat: miner cli: sectors list upgrade-bounds tool
2023-05-30 20:34:38 +02:00
swift-mx
196cd0b739
fix: add more log for error 2023-05-31 00:06:50 +08:00
Łukasz Magiera
87ae60a2bc
Merge pull request #10650 from filecoin-project/vyzo/test/mpool-select
Add timing test for mpool select with a large mpool dump
2023-05-30 17:00:06 +02:00
Łukasz Magiera
183e35f7b7
Merge pull request #10925 from filecoin-project/asr/drop-orange-check
feat: slashfilter: drop outdated near-upgrade check
2023-05-30 16:56:43 +02:00
Aayush Rajasekaran
3d061ba0ae
Merge pull request #10649 from filecoin-project/asr/test-gas-reward
test: messagepool: gas rewards are negative if GasFeeCap too low
2023-05-30 10:25:35 -04:00
mx
425661772d style:Refactoring slashfilter 2023-05-30 14:33:35 +08:00
Aayush Rajasekaran
b76b5ef4b7
Merge pull request #10863 from AnomalRoil/fix/fuzz/48208
fix: types: error out on decoding BlockMsg with extraneous data
2023-05-29 16:58:41 -04:00
Aayush Rajasekaran
867a7b1c01
Merge pull request #10628 from filecoin-project/asr/exec-trace-compute
fix: include extra messages in ComputeState InvocResult output
2023-05-29 12:56:43 -04:00
Aayush
10ed18ba12 test: messagepool: gas rewards are negative if GasFeeCap too low 2023-05-29 12:54:04 -04:00
Aayush Rajasekaran
0ec2acbf20
Merge pull request #10652 from filecoin-project/asr/mpool-fee-too-low
feat: pubsub: treat ErrGasFeeCapTooLow as ignore, not reject
2023-05-29 12:53:38 -04:00
Aayush
228b306370 feat: slashfilter: drop outdated near-upgrade check 2023-05-29 11:12:19 -04:00
Łukasz Magiera
14f9770859 feat: miner cli: sectors list upgrade-bounds tool 2023-05-26 12:29:36 +02:00
Łukasz Magiera
8c8e287be0
Merge pull request #10896 from filecoin-project/feat/chainindex-sharded-mutex
feat: chainstore: sharded mutex for filling chain height index
2023-05-24 12:49:16 +02:00
simlecode
6ec413b7ad fix: not call RUnlock 2023-05-23 17:43:39 +08:00
Yolan Romailler
00e34436b3
Addressing code review comments
Signed-off-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
2023-05-22 21:47:55 +02:00
Jakub Sztandera
cad743ec54
Appease the linter
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2023-05-19 20:02:47 +02:00
Jakub Sztandera
dfa7fc7723
feat: chainstore: sharded mutex for filling chain height index
This PR introduces as sharded mutex within the ChainIndex#GetTipsetByHeight.
It also replaces a go map with xsync.Map which doesn't require locking.

The lock is taken when it appears that ChainIndex filling work should be
started. After claiming the lock, the status of the cache is rechecked,
if the entry is still missing, the fillCache is started.

Thanks to @snissn and @arajasek for debugging and taking initial stabs at this.

Supersedes #10866 and 10885

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
2023-05-19 19:49:22 +02:00
gammazero
f35fa5757a Replace use of storetheindex with go-libipni 2023-05-17 11:41:00 -07:00
Shrenuj Bansal
b0d1385273 Check if epoch is negative in GetTipsetByHeight 2023-05-16 21:19:03 -04:00
Yolan Romailler
0d7d906abf
Adding extra data check on DecodeBlockMsg
fix: types: error out on decoding BlockMsg with extraneous data
Fixes OSS-fuzz issue 48208: lotus:fuzz_block_msg

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2023-05-12 21:32:44 +02:00
Friðrik Ásmundsson
b4ea0db04f
Merge pull request #10719 from filecoin-project/10622-add-eth-syncing
feat: Add eth_syncing RPC method
2023-05-10 16:21:11 -04:00
Fridrik Asmundsson
2bc205ed62 feat: Add eth_syncing RPC method
This commit adds eth_syncing RPC method which returns an object
with data about the sync status or false.
2023-05-10 16:08:18 -04:00
Aayush
fb228ebbff feat: mempool: reintroduce ForEachPendingMessage 2023-05-10 14:19:33 -04:00
Friðrik Ásmundsson
ceb3f1e41e
Validate that FromBlock/ToBlock epoch is indeed a hex value (#10780)
* Validate that FromBlock/ToBlock epoch is indeed a hex value

* Adding tests
2023-05-09 17:17:23 -04:00
Aayush
596b01fba2 feat: chainstore: exit early in MaybeTakeHeavierTipset 2023-05-05 13:56:48 -04:00
Mike Seiler
9c05a1f734 chain errors using xerrors.Errorf 2023-05-04 23:50:07 -10:00
Friðrik Ásmundsson
e6c8072f50
Merge pull request #10827 from filecoin-project/10585-address-review-comments
10585 address review comments
2023-05-04 18:32:04 +00:00
Fridrik Asmundsson
4e8ee737fc Address review comments 2023-05-04 17:10:26 +00:00
Aayush
b45409262f feat: deflake msgindex_test.go 2023-05-04 12:04:28 -04:00
Friðrik Ásmundsson
dec3af7d7f
Merge pull request #10585 from filecoin-project/10584-make-execution-cache-size-configurable
feat: Make execution trace configurable via env variable
2023-05-04 14:07:35 +00:00
Mikers
c1d22d8b32
refactor: streamline error handling in CheckPendingMessages (#10818) 2023-05-03 11:12:47 -10:00
Mikers
742062f84c
perf: mempool: lower priority optimizations (#10693)
* release the read lock earlier as it is not needed for chaincomputebasefee

* chain/messagepool/selection.go change to read lock in SelectMessages

* tighten up locks in chain/messagepool/repub.go and two questions on whether curTsLks are needed as comments

* include suggestion from @Jorropo to preallocate our msgs array so that we only need to make a single allocation

* mp.pending should not be accessed directly but through the getter

* from @arajasek: just check whether the sender is a robust address (anything except an ID address is robust) here, and return if so. That will:

be faster
reduce the size of this cache by half, because we can drop mp.keyCache.Add(ka, ka) on line 491.

* do not need curTslk and clean up code comments
2023-05-03 16:31:39 -04:00
Aayush
49f5825296 feat: chainstore: batch writes of tipsets 2023-05-02 17:26:07 -04:00
Aayush Rajasekaran
ff0fa3471f
chore: refactor: drop unused IsTicketWinner (#10801) 2023-05-02 11:22:02 -07:00
Steven Allen
bb5ba64cca Revert "Merge pull request #9858 from adlrocha/adlrocha/consistent-bcast"
This reverts commit 8b2208fd9a, reversing
changes made to 2db6b12b78.

Unfortunately, this is rather tricky code. We've found several issues so
far and, while we've fixed a few, there are outstanding issues that
would require complex fixes we don't have time to tackle right now.

Luckily, this code isn't actually needed by the main Filecoin chain
which relies on consensus fault reporting to handle equivocation. So we
can just try again later.
2023-04-27 12:25:30 -07:00
Steven Allen
d2c3e84d54
feat: sync: harden chain sync (#10756)
* fix: sync: fail sync instead of logging if we sync the wrong chain

* fix: sync: write headers in the correct order

Just in case. This shouldn't be necessary, but we might as well.

* fix: minus minus

* fix: do put the tipset

Put != Persist
2023-04-26 14:12:45 -07:00
Aayush Rajasekaran
eb0b1c986b
Merge pull request #10713 from filecoin-project/steb/fix-event-subscription
fix: events: don't set GC confidence to 1
2023-04-26 16:14:20 -04:00
Steven Allen
a97dae8f46 fix: sync: reduce log from error to info
And fix the message to account for the fact that we now reject _old_
blocks along with new ones.

We frequently receive "out of date" blocks in hello messages from
syncing and/or out of sync nodes. This isn't an error.
2023-04-25 14:34:13 -07:00
Steven Allen
7162c656cc
fix: chain: record heaviest tipset before notifying (#10694)
Clearly this hasn't caused any issues, but I'm pretty sure we should be
updating the current head _before_ notifying about it.
2023-04-25 11:56:26 -07:00
ychiao
9ae48022ff
fix: Eth JSON-RPC api: handle messages with gasFeeCap less than baseFee (#10614) 2023-04-24 16:03:04 +01:00
Aayush
5a061e4677 Merge branch 'releases' into asr/merge-release-into-master 2023-04-23 14:58:50 -04:00
Steven Allen
784214ae05
feat: sync: validate (early) that blocks fall within range (#10691)
This will reject blocks in pubsub validation if they're either:

1. Too far into the future (5 blocks beyond the expected head).
2. Too far into the past (before finality with respect to our current
   head).

Specifically:

1. We were previously rejecting future blocks in the sync logic, but not
   in pubsub itself.
2. We never used to check if a block was too _old_.

Motivation: Blocks that are too new/too old can cause us to perform
quite a bit of unnecessary work.
2023-04-22 10:15:31 -07:00
Hector Sanjuan
875c09840b
chainstore: Fix raw blocks getting scanned for links during snapshots (#10684)
We have to save raw blocks to the snapshot, but we should not be scanning them
for additional links as if they were CBOR blocks.

This cleans the logic a bit (we were checking that the parent was a CBOR block
before queueing up the children, but then scanning the children... it was weird).

Additionally, more verbose logging is added for the next time ScanForLinks
fails (currently very little info was given).

Our ScanForLinks callback should only enqueue CBOR for further processing.
2023-04-21 15:16:26 -07:00
Friðrik Ásmundsson
9d5d6a5f3d
Merge pull request #10700 from filecoin-project/10538-opt-ethgettransactioncount
perf: Address performance of EthGetTransactionCount
2023-04-21 20:13:56 +00:00
Fridrik Asmundsson
4028c05fea address review comment 2023-04-21 20:03:13 +00:00