Commit Graph

4212 Commits

Author SHA1 Message Date
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
Fridrik Asmundsson
553da395e4 perf: Increase noncecache in MessagePool
Bumped from 256 to 32k entries which should be about 6MB of cached
entries given average nonceCacheKey of 200 bytes
2023-04-21 11:56:05 +00:00
Fridrik Asmundsson
953d56e216 perf: Address performance of EthGetTransactionCount
We have observed that EthGetTransactionCount is one of the hotspots
on Glif production notes, and we are seeing regular 10-20 second
latencies when calling this rpc method.

I tracked the high latency spikes and they were correlated when
we were running ExecuteTipSet while following the chain.

To address this, we should not rely on tipset computation to get
nounce and instead look at the parent tipset and then count the
messages sent from the 'addr'.
2023-04-21 11:55:46 +00:00
Łukasz Magiera
a503a0edaa
Merge pull request #10690 from filecoin-project/fix/remove-pointless-panic
fix: remove pointless panic
2023-04-21 13:47:12 +02:00
Łukasz Magiera
0a46fc7e73
Merge pull request #10562 from Jorropo/boxo
chore: boxo: migrate from go-libipfs to boxo
2023-04-20 16:24:22 +02:00
Steven Allen
141c020b4e fix: remove pointless panic
Technically, the block validator caught this panic. But it's pointless
because we have a _real_ mechanism to return the validation reason,
which we should have been using.

In general, panicing like this is a very bad idea because it's
non-obvious and, in this case, completely undocumented.
2023-04-18 15:44:56 -07:00
Jorropo
fe42d974a2 chore: all: migrate from go-libipfs to boxo
github.com/ipfs/libipfs/blocks was unmigrated to github.com/ipfs/go-block-format due to compatibility issues with the rest of the IPLD stack.
2023-04-18 17:22:18 +02:00
Steven Allen
e945c0d6f2
fix: check for nil bcastDict (#10646)
Also hold the lock when checking the length of the blocks in the
bcastDict.
2023-04-17 20:17:10 -07:00
Steven Allen
3f74840b67
test: events: fix race when recording tipsets (#10665)
fixes #10664
2023-04-13 17:20:34 -07:00
vyzo
b4e2e871dc prune excess messages before selection 2023-04-11 13:12:05 +03:00
Jiaying Wang
522388820a
Merge pull request #10552 from filecoin-project/asr/optimize-blockmsgsfortipset
feat: chainstore: optimize BlockMsgsForTipset
2023-04-04 13:53:23 -04:00
vyzo
bf666a3f7e
Merge pull request #10551 from filecoin-project/vyzo/feat/exec-lanes
feat: VM Execution Lanes
2023-03-30 22:19:11 +03:00
Aayush Rajasekaran
139bde3771
Merge pull request #10561 from filecoin-project/mikers/messagepoolRWMutexes
perf: message pool: change locks to RWMutexes for performance
2023-03-30 12:47:44 -04:00
vyzo
d71b528253 reorg initialization code for better readability, remove unused import 2023-03-30 18:15:13 +03:00
vyzo
7b4e68249a add comment about Signal unsoundness 2023-03-30 18:13:08 +03:00
vyzo
54a80a8a97 revert dead code 2023-03-30 18:11:44 +03:00
Aayush Rajasekaran
8b2208fd9a
Merge pull request #9858 from adlrocha/adlrocha/consistent-bcast
feat:networking:  (Synchronous) Consistent Broadcast for Filecoin EC
2023-03-30 09:32:09 -04:00
adlrocha
682ddf6ffa
Update chain/sub/bcast/consistent.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2023-03-30 12:38:00 +02:00
Aayush
66fc6dc3e5 refactor: stop using deprecated io/ioutil 2023-03-29 15:40:49 -04:00
Friðrik Ásmundsson
36913db0cd
Merge pull request #10587 from filecoin-project/10583-enable-index-for-statewaitformessage
feat: Use MessageIndex in WaitForMessage
2023-03-29 18:38:39 +02:00
Mikers
41ea5a6f63
Update chain/messagepool/messagepool.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2023-03-29 05:44:25 -10:00
vyzo
52d70d563a fix tests 2023-03-29 16:46:37 +03:00
vyzo
4184ce9c75 refactor execution lanes: hide the lock 2023-03-29 16:45:45 +03:00
Fridrik Asmundsson
f44fa5d96f Use MessageIndex in WaitForMessage 2023-03-29 13:35:27 +02:00
Fridrik Asmundsson
8aa4917741 Fix bug in searchForIndexedMsg which always returns an error 2023-03-29 13:18:26 +02:00
Mike Seiler
3477f7ce57 use LRU cache for keyCache to make threadsafe, also have (high) upper bounds on size of cache 2023-03-28 13:14:33 -10:00
Mike Seiler
89b217ee21 move write lock to before verifyMsg 2023-03-28 12:35:09 -10:00
Mike Seiler
2fa95a09be clean up cache logic in addTs / fix a bug where the loop was incorrectly releasing the lock 2x 2023-03-28 11:14:13 -10:00
Aayush Rajasekaran
4b2e74a6df
Merge pull request #10535 from hsanjuan/filcryo-v1.20.0-branch
Fix: export-range: Ignore ipld Blocks not found in Receipts.
2023-03-28 16:01:11 -04:00
Aayush Rajasekaran
687f0c070f
Merge pull request #10556 from filecoin-project/10537-populate-index-after-snapshot
feat: populate the index on snapshot import
2023-03-28 11:41:43 -04:00
Fridrik Asmundsson
ecd13079e7 Address review comments 2023-03-28 17:08:53 +02:00
vyzo
71650cd8a4 rename newVM to makeVM for a happy yushie 2023-03-28 18:05:00 +03:00
vyzo
b27121612e rename confusing variable 2023-03-28 18:03:55 +03:00
vyzo
b2b78e9dfa
Update chain/vm/execution.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2023-03-28 17:56:35 +03:00
Alfonso de la Rocha
b7c297c537 Merge branch 'master' into adlrocha/consistent-bcast 2023-03-28 16:55:06 +02:00
Alfonso de la Rocha
1a771e4310
include a deeper gc round 2023-03-28 16:52:32 +02:00
vyzo
dcd9869842 make gen 2023-03-28 16:58:09 +03:00
Hector Sanjuan
39b27e709e export-range: use debug log instead of warn for not found receipt events 2023-03-28 15:05:43 +02:00
Fridrik Asmundsson
2e45f6f778 Dont do locking using defer 2023-03-28 12:36:57 +02:00
Fridrik Asmundsson
f84f8a831a Use TipSetKey as key in cache and return copies 2023-03-28 12:36:57 +02:00
Fridrik Asmundsson
1ea7e05cde feat: Add small cache to execution traces
This PR adds a small cache to calls to ExecutionTrace which helps
 improve performance for node operators like exchanges and block
explorers.

If items is in cache calls to this function will be 2-3x faster.

Fixes: https://github.com/filecoin-project/lotus/issues/10504
2023-03-28 12:36:52 +02:00
Mikers
831f8a499d repub needs Lock not RLock 2023-03-28 08:40:41 +00:00
Alfonso de la Rocha
df82a8240e
add comments 2023-03-28 10:33:26 +02:00
Mikers
e9d2223025 disallow infinite loop, since in testing this only runs once 2023-03-28 08:11:23 +00:00
Mikers
ad81cd18c2 cache the tipset nonce calculation before holding the write lock, and also verify that the the calculation is cached after grabbing the write lock. if it is not cached, give up the lock, calculate, and then grab the write lock again 2023-03-28 08:11:00 +00:00
Alfonso de la Rocha
92f6d3e468
global locking strategy for blockInfo map 2023-03-28 10:01:43 +02:00
Fridrik Asmundsson
90171c8bab Addressing lint errors 2023-03-25 11:17:54 +00:00