Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(badger): add support for Badger version 4. The default remains Badger version 2 to ensure backward compatibility. #12316

Open
wants to merge 66 commits into
base: feat/faster-datastore-with-badger
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
30fbab6
wip
snissn Jul 19, 2024
7a278cf
delete vim swaps
snissn Jul 19, 2024
bee642a
check in wip
snissn Jul 20, 2024
b077093
wip
snissn Jul 25, 2024
0e14b09
wip
snissn Jul 27, 2024
a4b7538
options
snissn Jul 27, 2024
6c4f012
clean
snissn Jul 27, 2024
1690d3d
merge fix
snissn Jul 27, 2024
4adc087
docsgen
snissn Jul 27, 2024
a3c1c2d
progress on options/logger
snissn Jul 29, 2024
da5f823
last usage of Send wrapped using ForEach
snissn Jul 29, 2024
e4ffc68
changelog
snissn Jul 29, 2024
b3ecb25
go mod tidy
snissn Jul 29, 2024
6aa56cc
default to 2
snissn Jul 29, 2024
94f3ce4
set default badger version to 2
snissn Jul 29, 2024
5aefc8e
prefix bugfix
snissn Jul 29, 2024
d680f6f
clean up lotus-bench for pr
snissn Jul 30, 2024
0daa826
make docsgen
snissn Jul 30, 2024
dafc880
lint fixes
snissn Jul 30, 2024
395be91
fix func signature
snissn Jul 30, 2024
91d5680
merge conflict resolve - confirm f6978f01725fc8f8ef72cdf83d15aa57b8e0…
snissn Jul 30, 2024
fd626f9
bugfix
snissn Jul 30, 2024
900d31f
unused lint fix
snissn Jul 30, 2024
d0143fb
lintfix
snissn Jul 30, 2024
1b1bbd0
debugging test
snissn Jul 30, 2024
55918db
wip - fixes tests
snissn Jul 31, 2024
a1d39a7
clean up creation of blockstore
snissn Jul 31, 2024
dd95024
connect badgerVersion config with creation of blockstores
snissn Jul 31, 2024
279f2ba
bugfixes
snissn Jul 31, 2024
9f82d83
bugfix for make buildall
snissn Jul 31, 2024
c01521f
autogen
snissn Jul 31, 2024
92c3f2d
bugfix import bench
snissn Jul 31, 2024
ab99ef0
get tests to work with v2
snissn Jul 31, 2024
feac779
add both versions to badger test
snissn Jul 31, 2024
3fd2707
fmt
snissn Jul 31, 2024
48f50a6
keep ctx in doCopy
snissn Jul 31, 2024
2cac6a6
gofmt
snissn Jul 31, 2024
df59d5d
gofmt
snissn Jul 31, 2024
2a65044
clamp unused
snissn Jul 31, 2024
50cabd0
use cfg.Chainstore with BadgerHotBlockstore
snissn Aug 12, 2024
cab56a8
bugfix test all badger versions
snissn Aug 12, 2024
6c92ba1
Merge branch 'master' into mikers/BadgerVersions
snissn Aug 12, 2024
c461160
remove dead code for DefaultOptions and restore comments and keep v2 …
snissn Aug 12, 2024
6346cc6
Merge branch 'mikers/BadgerVersions' of github.com:filecoin-project/l…
snissn Aug 12, 2024
52604e9
remove unused AllKeysChan
snissn Aug 12, 2024
4de5f71
remove unused DeleteBlock method
snissn Aug 12, 2024
d2de85e
Update node/config/types.go
snissn Aug 13, 2024
ee737c9
Update blockstore/badger/versions/badger.go
snissn Aug 13, 2024
6d5d679
item.Version is unused
snissn Aug 13, 2024
26610e7
Merge branch 'mikers/BadgerVersions' of github.com:filecoin-project/l…
snissn Aug 13, 2024
c973d48
Update blockstore/badger/versions/badger.go
snissn Aug 13, 2024
0dc3a85
Update blockstore/badger/versions/badger.go
snissn Aug 13, 2024
624779f
lint and add import
snissn Aug 13, 2024
c7e3a84
Merge branch 'mikers/BadgerVersions' of github.com:filecoin-project/l…
snissn Aug 13, 2024
7b22c1c
makegen
snissn Aug 13, 2024
59fe7e3
feat: f3: update go-f3 to 0.2.0 (#12390)
Kubuxu Aug 15, 2024
d415d9f
docs: update references to releases branch (#12396)
BigLep Aug 15, 2024
517c7ae
fix(ci): don't PR or changelog check for draft PRs (#12405)
rvagg Aug 19, 2024
0225c91
chore: post release steps for #12379 (v1.28.2 miner and node patch re…
rjan90 Aug 19, 2024
dbef5de
feat(libp2p): expose libp2p bandwidth metrics (#12402)
Stebalien Aug 19, 2024
a5cb674
fix: error check
qwdsds Aug 20, 2024
8518d23
build: update Lotus Node version to v1.29.1-dev in master (#12409)
rjan90 Aug 22, 2024
475139f
chore: deps: update to CGO-free go-crypto (#12411)
ribasushi Aug 23, 2024
4a4ddaa
docs: updates about branches and where to target PRs (#12416)
BigLep Aug 28, 2024
8f4299e
disable snappy compression in badger v4
snissn Aug 30, 2024
5ccbb3c
merge
snissn Aug 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- reopened
- labeled
- unlabeled
- ready_for_review
paths:
- '**.go'
- '**/go.mod'
Expand All @@ -17,7 +18,8 @@ on:
jobs:
changelog:
if: contains(github.event.pull_request.title, '[skip changelog]') == false &&
contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false
contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false &&
github.event.pull_request.draft == false
runs-on: ubuntu-latest
name: Changelog
steps:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: PR Title Check

on:
pull_request_target:
types: [opened, edited, synchronize, reopened]
types:
- opened
- edited
- reopened
- ready_for_review

permissions:
pull-requests: write

jobs:
check-pr-title:
if: github.event.pull_request.draft == false
name: Check PR Title
runs-on: ubuntu-latest
steps:
Expand Down
47 changes: 17 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,12 @@

# UNRELEASED

- https://github.com/filecoin-project/lotus/pull/12203: Fix slice modification bug in ETH Tx Events Bloom Filter
- https://github.com/filecoin-project/lotus/pull/12221: Fix a nil reference panic in the ETH Trace API
- https://github.com/filecoin-project/lotus/pull/12112: Moved consts from build/ to build/buildconstants/ for ligher curio deps.
- https://github.com/filecoin-project/lotus/pull/12237: Upgrade to go-f3 `v0.0.4`.
- https://github.com/filecoin-project/lotus/pull/12251: Dropping support from ProveCommitSector1 method from lotus-miner
- https://github.com/filecoin-project/lotus/pull/12276: chore: deps: Update GST, Filecoin-FFI and Actors to final versions NV23
- https://github.com/filecoin-project/lotus/pull/12278: chore: Set Mainnet upgrade epoch for NV23.
- https://github.com/filecoin-project/lotus/pull/12269 Fix `logIndex` ordering in `EthGetTransactionReceipt` by using the EventIndex to fetch logs
- https://github.com/filecoin-project/lotus/pull/12270: Feat expose `settle-deal` command for lotus miner to settle deals manually
- https://github.com/filecoin-project/lotus/pull/12285 Set up OpenTelemetry metrics reporting to prometheus
- https://github.com/filecoin-project/lotus/pull/12279 Upgrade to go-f3 v0.0.5
- https://github.com/filecoin-project/lotus/pull/12295 Upgrade to go-f3 v0.0.6
- https://github.com/filecoin-project/lotus/pull/12292: feat: p2p: allow overriding bootstrap nodes with environmemnt variable
- https://github.com/filecoin-project/lotus/pull/12319: feat: `lotus send CLI`: allow sending to ETH addresses
- https://github.com/filecoin-project/lotus/pull/12332: fix: ETH RPC: receipts: use correct txtype in receipts
- https://github.com/filecoin-project/lotus/pull/12335: fix: lotus-shed: store processed tipset after backfilling events
- https://github.com/filecoin-project/lotus/pull/12341: fix: miner: Fix DDO pledge math

## ☢️ Upgrade Warnings ☢️

- lotus-gateway behaviour, CLI arguments and APIs have received minor changes. See the improvements section below.

## New features

- feat: Add trace filter API supporting RPC method `trace_filter` ([filecoin-project/lotus#12123](https://github.com/filecoin-project/lotus/pull/12123)). Configuring `EthTraceFilterMaxResults` sets a limit on how many results are returned in any individual `trace_filter` RPC API call.
- feat: Add support for Badger version 4. The default remains Badger version 2 to ensure backward compatibility. ([filecoin-project/lotus#12316](https://github.com/filecoin-project/lotus/pull/12316)). Configuring `LOTUS_CHAINSTORE_BADGERVERSION` can configure lotus to use badger version 2 and 4.
- feat: `FilecoinAddressToEthAddress` RPC can now return ETH addresses for all Filecoin address types ("f0"/"f1"/"f2"/"f3") based on client's re-org tolerance. This is a breaking change if you are using the API via the go-jsonrpc library or by using Lotus as a library, but is a non-breaking change when using the API via any other RPC method as it adds an optional second argument.
([filecoin-project/lotus#12324](https://github.com/filecoin-project/lotus/pull/12324)).
- feat: Added `lotus-shed indexes inspect-events` health-check command ([filecoin-project/lotus#12346](https://github.com/filecoin-project/lotus/pull/12346)).
Expand All @@ -38,16 +19,22 @@

## Improvements

- feat!: gateway: fix rate limiting, better stateful handling ([filecoin-project/lotus#12315](https://github.com/filecoin-project/lotus/pull/12315)).
- CLI usage documentation has been improved for `lotus-gateway`
- `--per-conn-rate-limit` now works as advertised.
- `--eth-max-filters-per-conn` is new and allows you to set the maximum number of filters and subscription per connection, it defaults to 16.
- Previously, this limit was set to `16` and applied separately to filters and subscriptions. This limit is now unified and applies to both filters and subscriptions.
- Stateful Ethereum APIs (those involving filters and subscriptions) are now disabled for plain HTTP connections. A client must be using websockets to access these APIs.
- These APIs are also now automatically removed from the node by the gateway when a client disconnects.
- Some APIs have changed which may impact users consuming Lotus Gateway code as a library.
- The default value for the `Events.FilterTTL` config option has been reduced from 24h to 1h. This means that filters will expire on a Lotus node after 1 hour of not being accessed by the client.
- feat(f3): F3 has been updated with many performance improvements and additional metrics.
# 1.28.2 / 2024-08-15

This is a Lotus patch release v1.28.2 for Node operators and Storage Providers.

For node operators, this patch release is HIGHLY RECOMMENDED as it fixes an issue where excessive bandwidth usage (issue #12381) was caused by a routing loop in pubsub, where small "manifest" messages were cycling repeatedly around the network due to an ineffective routing loop prevention mechanism. The new f3 release also has a couple performance improvements around CPU usage. (If you are curious about the progress of F3 testing, follow the updates [here](https://github.com/filecoin-project/lotus/discussions/12287#discussioncomment-10343447)).

For storage providers, this patch release fixes pledge issues users have been encountering. This update addresses existing issues, including the too-small pledge in snap and the lack of DDO-awareness in PoRep Commit.

## ☢️ Upgrade Warnings ☢️
- The `releases` branch has been deprecated with the 202408 split of 'Lotus Node' and 'Lotus Miner'. See https://github.com/filecoin-project/lotus/blob/master/LOTUS_RELEASE_FLOW.md#why-is-the-releases-branch-deprecated-and-what-are-alternatives for more info and alternatives for getting the latest release for both the 'Lotus Node' and 'Lotus Miner' based on the [Branch and Tag Strategy](https://github.com/filecoin-project/lotus/blob/master/LOTUS_RELEASE_FLOW.md#branch-and-tag-strategy).
- To get the latest Lotus Node tag: `git tag -l 'v*' | sort -V -r | head -n 1`
- To get the latest Lotus Miner tag: `git tag -l 'miner/v*' | sort -V -r | head -n 1`
- Breaking change in Miner public APIs `storage/pipeline.NewPreCommitBatcher` and `storage/pipeline.New`. They now have an additional error return to deal with errors arising from fetching the sealing config.

- https://github.com/filecoin-project/lotus/pull/12390: Update go-f3 to 0.2.0
- https://github.com/filecoin-project/lotus/pull/12341: fix: miner: Fix DDO pledge math

# v1.28.1 / 2024-07-24

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Lotus is a universally open project and welcomes contributions of all kinds: cod

## Before Contributing

1. If the proposal entails a protocol change, please first submit a [Filecoin Improvement Proposal](https://github.com/filecoin-project/FIPs).
2. If the change is complex and requires prior discussion, [open an issue](github.com/filecoin-project/lotus/issues) or a [discussion](https://github.com/filecoin-project/lotus/discussions) to request feedback before you start working on a pull request. This is to avoid disappointment and sunk costs, in case the change is not actually needed or accepted.
3. Please refrain from submitting PRs to adapt existing code to subjective preferences. The changeset should contain functional or technical improvements/enhancements, bug fixes, new features, or some other clear material contribution. Simple stylistic changes are likely to be rejected in order to reduce code churn.
4. Familiarize yourself with our [release flow](LOTUS_RELEASE_FLOW.md) to understand how changes are incorporated into releases.
1. Familiarize yourself with our [release flow](LOTUS_RELEASE_FLOW.md) to understand how changes are incorporated into releases. This includes our branch strategy and where to target PRs.
2. If the proposal entails a protocol change, please first submit a [Filecoin Improvement Proposal](https://github.com/filecoin-project/FIPs).
3. If the change is complex and requires prior discussion, [open an issue](github.com/filecoin-project/lotus/issues) or a [discussion](https://github.com/filecoin-project/lotus/discussions) to request feedback before you start working on a pull request. This is to avoid disappointment and sunk costs, in case the change is not actually needed or accepted.
4. Please refrain from submitting PRs to adapt existing code to subjective preferences. The changeset should contain functional or technical improvements/enhancements, bug fixes, new features, or some other clear material contribution. Simple stylistic changes are likely to be rejected in order to reduce code churn.

## Implementing Changes

Expand Down
25 changes: 10 additions & 15 deletions LOTUS_RELEASE_FLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,19 @@ Unless a security issue is actively being exploited or a significant number of u

## Branch and Tag Strategy

> [!NOTE]
> - <span style="color:blue">Blue text</span> indicates node-related information.
> - <span style="color:orange">Orange text</span> indicates miner-related information.
> - System default colored text applies to both node and miner releases.

* Releases are branched from the `master` branch, regardless of whether they include a network upgrade or not.
* Releases are usually branched from the `master` branch, regardless of whether they include a network upgrade or not.
* For certain patch releases where we can't risk including recent `master` changes (such as for security or emergency bug-fix releases):
* Node: `release/vX.Y.Z+1` will be created from `release/vX.Y.Z`
* Miner: `release/miner/vX.Y.Z+1` will be created from `release/miner/vX.Y.Z`
* PRs usually target the `master` branch, even if they need to be backported to a release branch.
* The primary exception is CHANGELOG editorializing and callouts. As part of the [release process](https://github.com/filecoin-project/lotus/blob/master/documentation/misc/RELEASE_ISSUE_TEMPLATE.md), those changes happen directly in a release branch and are cherry-picked back to `master` at the end of a release.
* PRs that need to be backported should be marked with a `backport` label.
* <span style="color:blue">Node release branches are named `release/vX.Y.Z`</span>
* <span style="color:orange">Miner release branches are named `release/miner/vX.Y.Z`</span>
* Node release branches are named `release/vX.Y.Z`
* Miner release branches are named `release/miner/vX.Y.Z`
* By the end of the release process:
* <span style="color:blue">A `release/vX.Y.Z` branch (node) will have an associated `vX.Y.Z` tag</span>
* <span style="color:orange">A `release/miner/vX.Y.Z` branch (miner) will have an associated `miner/vX.Y.Z` tag</span>
* Both node and miner releases may have additional `vX.Y.Z-rcN` or `miner/vX.Y.Z-rcN` tags for release candidates
* The `master` branch is typically the source for creating release branches
* For emergency patch releases where we can't risk including recent `master` changes:
* <span style="color:blue">Node: `release/vX.Y.Z+1` will be created from `release/vX.Y.Z`</span>
* <span style="color:orange">Miner: `release/miner/vX.Y.Z+1` will be created from `release/miner/vX.Y.Z`</span>
* A `release/vX.Y.Z` branch (node) will have an associated `vX.Y.Z` tag
* A `release/miner/vX.Y.Z` branch (miner) will have an associated `miner/vX.Y.Z` tag
* Both node and miner releases may have additional `vX.Y.Z-rcN` or `miner/vX.Y.Z-rcN` tags for release candidates.
* As of 202408, the `releases` branch is no longer used and no longer tracks the latest release. See [Why is the `releases` branch deprecated and what are alternatives?](#why-is-the-releases-branch-deprecated-and-what-are-alternatives).

## FAQ
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Lotus is an implementation of the Filecoin Distributed Storage Network. For more

## Building & Documentation

> Note: The default `master` branch is the dev branch, please use with caution. For the latest stable version, checkout the most recent [`Latest release`](https://github.com/filecoin-project/lotus/releases).
> Note: The default `master` branch is the dev branch, please use with caution. For the latest stable version, checkout the [latest release](https://github.com/filecoin-project/lotus/blob/master/LOTUS_RELEASE_FLOW.md#why-is-the-releases-branch-deprecated-and-what-are-alternatives).

For complete instructions on how to build, install and setup lotus, please visit [https://lotus.filecoin.io](https://lotus.filecoin.io/lotus/install/prerequisites/#supported-platforms). Basic build instructions can be found further down in this readme.

Expand Down Expand Up @@ -83,9 +83,9 @@ Once all the dependencies are installed, you can build and install the Lotus sui
cd lotus/
```

Note: The default branch `master` is the dev branch where the latest new features, bug fixes and improvement are in. However, if you want to run lotus on Filecoin mainnet and want to run a production-ready lotus, get the latest release[ here](https://github.com/filecoin-project/lotus/releases).
Note: The default branch `master` is the dev branch where the latest new features, bug fixes and improvement are in. However, if you want to run lotus on Filecoin mainnet and want to run a production-ready lotus, get the [latest release](https://github.com/filecoin-project/lotus/blob/master/LOTUS_RELEASE_FLOW.md#why-is-the-releases-branch-deprecated-and-what-are-alternatives).

2. To join mainnet, checkout the [latest release](https://github.com/filecoin-project/lotus/releases).
2. To join mainnet, checkout the [latest release](https://github.com/filecoin-project/lotus/blob/master/LOTUS_RELEASE_FLOW.md#why-is-the-releases-branch-deprecated-and-what-are-alternatives).

If you are changing networks from a previous Lotus installation or there has been a network reset, read the [Switch networks guide](https://lotus.filecoin.io/lotus/manage/switch-networks/) before proceeding.

Expand Down
Loading
Loading