Commit Graph

158 Commits

Author SHA1 Message Date
gammazero
03826aac87 fix doc check 2023-08-23 19:05:21 -07:00
gammazero
7774ca0179 Add sequence number DoS test 2023-08-23 16:53:21 -07:00
gammazero
ca23a4406c Do not update message info cache until after message validation
The sequence number used for replay detection was being updated before message validation confirmed that the message originated from the correct host. This would allow one host A to create a message with the ID of another host B that could then update the cached sequence number for B. While the message from A would fail validation and be ignored, the cached sequence number for B would get updated. This would lead to a temporary DoS for host B as its messages were incorrectly rejected as replays.

This fixes the issue by setting the cached sequence number after message validation.
2023-08-23 14:30:22 -07:00
Shrenuj Bansal
bc5637c60a keep default action as reject and make all error actions explicit 2023-07-05 12:13:01 -04:00
Shrenuj Bansal
be3281bdcf Invert msg validation check to explicitly specify reject errors 2023-06-28 13:35:21 -04: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
2a6d0e5f6e fix: pubsub: do not treat ErrExistingNonce as Reject 2023-06-13 10:13:24 -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
gammazero
f35fa5757a Replace use of storetheindex with go-libipni 2023-05-17 11:41:00 -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
Ł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
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
Aayush
ae84f335cc feat: pubsub: treat ErrGasFeeCapTooLow as ignore, not reject 2023-04-11 10:26:43 -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
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
Alfonso de la Rocha
df82a8240e
add comments 2023-03-28 10:33:26 +02:00
Alfonso de la Rocha
92f6d3e468
global locking strategy for blockInfo map 2023-03-28 10:01:43 +02:00
Alfonso de la Rocha
90c2f9dbe2
minor fix 2023-03-16 17:17:59 +01:00
Alfonso de la Rocha
8d260d7478
address review 2023-03-16 17:03:25 +01:00
adlrocha
f59c246c7a
Update chain/sub/bcast/consistent.go
Co-authored-by: Aayush Rajasekaran <arajasek94@gmail.com>
2023-03-16 16:09:45 +01: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
dcb49dc8ee
refactor: update cache to the new generic version (#10463)
- Adds type safety.
- Reduces allocations.
- Fixes the drand cache (was storing by value, but retrieving by pointer)
2023-03-13 15:29:09 -07:00
Alfonso de la Rocha
c11ffa58a8
address review 2023-03-10 09:27:30 +01:00
Łukasz Magiera
d114d8fe7e deprecate MarketListRetrievalDeals, make gen 2023-03-08 17:15:16 +01:00
hannahhoward
7bc6185077
chore(deps): update to get to compile 2023-03-07 11:45:30 -08:00
Jorropo
f572852d06 chore: all: bump go-libipfs to replace go-block-format
Includes changes from:
- https://github.com/ipfs/go-block-format/pull/37
- https://github.com/ipfs/go-libipfs/pull/58
2023-01-26 17:03:18 +01:00
Alfonso de la Rocha
939e515d23
fix race in cb cache 2022-12-13 12:45:01 +01:00
Alfonso de la Rocha
f2cc452d4c
remove error from rcvBlock. type/docs gen 2022-12-13 12:13:20 +01:00
Alfonso de la Rocha
91bd679d1e consistent broadcast delay as build param 2022-12-13 11:13:51 +01:00
Alfonso de la Rocha
5626c69ce5 wip: abstract common fns required for consensus 2022-10-13 16:28:45 +02:00
Alfonso de la Rocha
0209052821
minor changes 2022-09-16 13:09:27 +02:00
Alfonso de la Rocha
72c80a3461
fixed unit tests 2022-09-16 09:22:37 +02:00
Alfonso de la Rocha
d1a4f1dc50
fixed bugs in consistent broadcast integration 2022-09-14 19:59:29 +02:00
Alfonso de la Rocha
1dadff303c
added garbage collection test. minor fix 2022-09-13 16:06:18 +02:00
Alfonso de la Rocha
76031d72ad
minor fixes. unit tests added 2022-09-13 12:33:28 +02:00
Alfonso de la Rocha
c03ad9dcfd
wip: draft impl of consistent bcast 2022-09-12 19:03:06 +02:00
Łukasz Magiera
08b22edd89 fix make gen 2022-08-29 16:25:30 +02:00
Łukasz Magiera
2086b219d2 Don't use go-libp2p-core 2022-08-25 14:20:41 -04:00
Łukasz Magiera
05cdeb80c3 chore: remove redundant import prefixes 2022-06-15 12:06:22 +02:00
Łukasz Magiera
e65fae28de chore: fix imports 2022-06-14 17:00:51 +02:00
Masih H. Derkani
b47cde70fa Decode gossip extra data as []bytes
The type of extra data in go-legs gossip is bytes. But when it is parsed
as miner ID, it is cast to string then parsed. Instead, it should be
decoded from bytes.
2022-02-11 18:59:00 +00:00
Will
296eab3045
Merge pull request #8045 from gammazero/feat/cid-to-piece-idx
Add indexer pubsub message authentication and rate limiting
2022-02-10 13:49:58 -08:00
gammazero
c1b2080f4e spelling in comment 2022-02-10 11:25:30 -08:00
gammazero
1e37185d74 Ignore, not regect, indexer messages from self. 2022-02-10 08:44:40 -08:00
gammazero
9481fa0a4b Use new indexer pubsub message encoding 2022-02-09 16:40:27 -08:00
gammazero
681ce94a34 Correctly handle seqno check 2022-02-09 16:21:05 -08:00
gammazero
3ff209d95d Add replay rejection 2022-02-09 11:06:56 -08:00
gammazero
a62e027002 review changes 2022-02-09 10:29:49 -08:00