Skip to content

Commit

Permalink
Merge branch 'mikers/BadgerVersions' of github.com:filecoin-project/l…
Browse files Browse the repository at this point in the history
…otus into mikers/BadgerVersions
  • Loading branch information
snissn committed Aug 12, 2024
2 parents c461160 + 6c92ba1 commit 6346cc6
Show file tree
Hide file tree
Showing 90 changed files with 2,834 additions and 571 deletions.
11 changes: 2 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@
Before you mark the PR ready for review, please make sure that:

- [ ] Commits have a clear commit message.
- [ ] PR title is in the form of of `<PR type>: <area>: <change being made>`
- example: ` fix: mempool: Introduce a cache for valid signatures`
- `PR type`: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
- `area`, e.g. api, chain, state, mempool, multisig, networking, paych, proving, sealing, wallet, deps
- [ ] Update CHANGELOG.md or signal that this change does not need it.
- If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
- If the change does not require a CHANGELOG.md entry, do one of the following:
- Add `[skip changelog]` to the PR title
- Add the label `skip/changelog` to the PR
- [ ] PR title conforms with [contribution conventions](https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions)
- [ ] Update CHANGELOG.md or signal that this change does not need it per [contribution conventions](https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#changelog-management)
- [ ] New features have usage guidelines and / or documentation updates in
- [ ] [Lotus Documentation](https://lotus.filecoin.io)
- [ ] [Discussion Tutorials](https://github.com/filecoin-project/lotus/discussions/categories/tutorials)
Expand Down
46 changes: 37 additions & 9 deletions .github/workflows/build-pulse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ on:
run_id:
description: The ID of the Test workflow run
required: true
run_attempt:
description: The attempt number of the Test workflow run
required: true
event_name:
description: The name of the event that triggered the Test workflow run
required: true
head_branch:
description: The name of the head branch that triggered the Test workflow
required: true
head_commit_id:
description: The commit ID of the head commit of the Test workflow run
description: The commit ID of the head commit that triggered the Test workflow run
required: true

defaults:
Expand All @@ -30,7 +39,14 @@ jobs:
- name: Check out lotus
uses: actions/checkout@v4
with:
path: lotus
ref: ${{ github.event.inputs.head_commit_id || github.event.workflow_run.head_commit.id }}
- name: Check out buildpulse-action
uses: actions/checkout@v4
with:
repository: buildpulse/buildpulse-action
path: buildpulse-action
ref: d0d30f53585cf16b2e01811a5a753fd47968654a # v0.11.0
- name: Create a temporary directory to store the JUnit XML reports
id: reports
run: mktemp -d | xargs -0 -I{} echo "path={}" | tee -a $GITHUB_OUTPUT
Expand All @@ -41,12 +57,24 @@ jobs:
github-token: ${{ github.token }}
path: ${{ steps.reports.outputs.path }}
- name: Upload test results to BuildPulse for flaky test detection
uses: buildpulse/buildpulse-action@d4d8e00c645a2e3db0419a43664bbcf868080234
with:
account: ${{ vars.BUIDPULSE_ACCOUNT_ID }}
repository: ${{ vars.BUILDPULSE_REPOSITORY_ID }}
path: |
env:
INPUT_ACCOUNT: ${{ vars.BUIDPULSE_ACCOUNT_ID }}
INPUT_REPOSITORY: ${{ vars.BUILDPULSE_REPOSITORY_ID }}
INPUT_PATH: |
${{ steps.reports.outputs.path }}/**/*.xml
key: ${{ vars.BUILDPULSE_ACCESS_KEY_ID }}
secret: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
commit: ${{ github.event.inputs.head_commit_id || github.event.workflow_run.head_commit.id }}
INPUT_KEY: ${{ vars.BUILDPULSE_ACCESS_KEY_ID }}
INPUT_SECRET: ${{ secrets.BUILDPULSE_SECRET_ACCESS_KEY }}
INPUT_COMMIT: ${{ github.event.inputs.head_commit_id || github.event.workflow_run.head_commit.id }}
INPUT_REPOSITORY_PATH: lotus
INPUT_RUN_ID: ${{ github.event.inputs.run_id || github.event.workflow_run.id }}
INPUT_RUN_ATTEMPT: ${{ github.event.inputs.run_attempt || github.event.workflow_run.run_attempt }}
INPUT_EVENT_NAME: ${{ github.event.inputs.event_name || github.event.workflow_run.event }}
INPUT_REF: ${{ github.event.inputs.head_branch || github.event.workflow_run.head_branch }}
INPUT_HEAD_REF: ${{ github.event.inputs.head_branch || github.event.workflow_run.head_branch }}
run: |
GITHUB_RUN_ID=$INPUT_RUN_ID \
GITHUB_RUN_ATTEMPT=$INPUT_RUN_ATTEMPT \
GITHUB_EVENT_NAME=$INPUT_EVENT_NAME \
GITHUB_REF=refs/heads/$INPUT_REF \
GITHUB_HEAD_REF=$INPUT_HEAD_REF \
./buildpulse-action/run.sh
5 changes: 1 addition & 4 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ jobs:
- if: steps.changelog.outputs.modified == '0'
env:
MESSAGE: |
docs/changelogs/ was not modified in this PR. Please do one of the following:
- add a changelog entry
- add `[skip changelog]` to the PR title
- label the PR with `skip/changelog`
docs/changelogs/ was not modified in this PR. Please do one of the options in [changelog management conventions](https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#changelog-management)
run: |
echo "::error::${MESSAGE//$'\n'/%0A}"
exit 1
52 changes: 52 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PR Title Check

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

permissions:
pull-requests: write

jobs:
check-pr-title:
name: Check PR Title
runs-on: ubuntu-latest
steps:
- name: Check PR Title and Manage Review
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const title = context.payload.pull_request.title;
// This should match https://github.com/filecoin-project/lotus/blob/master/README.md#pr-title-conventions
// 202408: Beyond Conventional Commit conventions, we also optionally suport the "scope" outside of paranenthesis for a transitionary period from legacy conventions per https://github.com/filecoin-project/lotus/pull/12340
const pattern = /^(\[skip changelog\]\s)?(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:?\s(\w+:)?\s?[a-z].+$/;
if (!pattern.test(title)) {
await github.rest.pulls.createReview({
...context.repo,
pull_number: context.payload.pull_request.number,
body: 'Please update the PR title to match https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions',
event: 'REQUEST_CHANGES'
});
core.setFailed('PR title does not match the required format');
} else {
const reviews = await github.rest.pulls.listReviews({
...context.repo,
pull_number: context.payload.pull_request.number
});
const botReview = reviews.data.find(review =>
review.user.type === 'Bot' &&
review.state === 'CHANGES_REQUESTED'
);
if (botReview) {
await github.rest.pulls.dismissReview({
...context.repo,
pull_number: context.payload.pull_request.number,
review_id: botReview.id,
message: 'PR title now matches the required format.'
});
}
}
8 changes: 4 additions & 4 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
- uses: actions/stale@v9
with:
repo-token: ${{ github.token }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 24 hours.'
stale-issue-message: 'We needed more information for this issue, please comment with more details or this issue will be closed in 72 hours.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-pr-message: 'Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 48 hours. You are always more than welcome to reopen the PR later as well!'
stale-pr-message: 'Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 72 hours. You are always more than welcome to reopen the PR later as well!'
close-pr-message: 'This PR was closed because it is missing author input. Please feel free to reopen the PR when you get to it! Thank you for your interest in contributing to lotus!'
stale-issue-label: 'kind/stale'
stale-pr-label: 'kind/stale'
any-of-labels: 'need/author-input '
days-before-issue-stale: 3
days-before-issue-close: 1
days-before-issue-close: 3
days-before-pr-stale: 5
days-before-pr-close: 2
days-before-pr-close: 3
remove-stale-when-updated: true
enable-statistics: true
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,43 @@
- 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

## ☢️ 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)).

## Enhancements

- fix: add datacap balance to circ supply internal accounting as unCirc #12348
- feat: Use a block cache to speed up the `EthGetBlockByHash` API: https://github.com/filecoin-project/lotus/pull/12359

## 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.

# v1.28.1 / 2024-07-24

Expand Down
68 changes: 68 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!-- omit from toc -->
# Contributing to Lotus

Lotus is a universally open project and welcomes contributions of all kinds: code, docs, and more. We appreciate your interest in contributing!

- [Before Contributing](#before-contributing)
- [Implementing Changes](#implementing-changes)
- [PR Title Conventions](#pr-title-conventions)
- [CHANGELOG Management](#changelog-management)
- [Markdown Conventions](#markdown-conventions)
- [Table Of Contents](#table-of-contents)
- [Getting Help](#getting-help)

## 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.

## Implementing Changes

When implementing a change:

1. Adhere to the standard Go formatting guidelines, e.g. [Effective Go](https://golang.org/doc/effective_go.html). Run `go fmt`.
2. Stick to the idioms and patterns used in the codebase. Familiar-looking code has a higher chance of being accepted than eerie code. Pay attention to commonly used variable and parameter names, avoidance of naked returns, error handling patterns, etc.
3. Comments: follow the advice on the [Commentary](https://golang.org/doc/effective_go.html#commentary) section of Effective Go.
4. Minimize code churn. Modify only what is strictly necessary. Well-encapsulated changesets will get a quicker response from maintainers.
5. Lint your code with [`golangci-lint`](https://golangci-lint.run) (CI will reject your PR if unlinted).
6. Add tests.
7. Write clean, thoughtful, and detailed [commit messages](https://chris.beams.io/posts/git-commit/). This is even more important than the PR description, because commit messages are stored _inside_ the Git history. One good rule is: if you are happy posting the commit message as the PR description, then it's a good commit message.

## PR Title Conventions

PR titles should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard.
This means the PR title should be in the form of `<type>(<scope>): <description>`
- example: `fix(mempool): introduce a cache for valid signatures`
- `type`: MUST be one of _build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test_
- `scope`: OPTIONAL arbitrary string that is usually one of _api, chain, deps, mempool, multisig, networking, paych, proving, sealing, state, wallet_
- Breaking changes must add a `!`
- Optionally the PR title can be prefixed with `[skip changelog]` if no changelog edits should be made for this change.

Note that this is enforced with https://github.com/filecoin-project/lotus/blob/master/.github/workflows/pr-title-check.yml

## CHANGELOG Management

To expedite the release process, the CHANGELOG is built-up incrementally.
We enforce that each PR updates CHANGELOG.md or signals that the change doesn't need it.
If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
If the change does not require a CHANGELOG.md entry, do one of the following:
- Add `[skip changelog]` to the PR title
- Add the label `skip/changelog` to the PR

Note that this is enforced with https://github.com/filecoin-project/lotus/blob/master/.github/workflows/changelog.yml

## Markdown Conventions
We optimize our markdown files for viewing on GitHub. That isn't to say other syntaxes can't be used, but that is the flavor we focus on and at the minimum don't want to break.

### Table Of Contents
For longer documents, we tend to inline a table of contents (TOC). This is slightly annoying with Markdown on GitHub because the actual table of contents needs to be checked-in rather than just giving a directive to the renderer like []`[[_TOC_]]` on GitLab](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents). (Yes GitHub UI does enable someone to see an auto-generated outline if they click the "outline" button on the top right-hand corner when viewing a Markdown file, but that isn't necessarily obvious to users, requires an extra click, and doesn't enable any customization.)

[There is tooling](https://stackoverflow.com/questions/11948245/markdown-to-create-pages-and-table-of-contents) that can help with auto-generating and updating a TOC and allow customization. Maintainers aren't wedded to a particular format/standard/tool but have gone with [VS Code Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) because it has what we needed and is the most popular VS Code plugin for this functionality (at least as of 202408).

## Getting Help

If you need help with your contribution, please don't hesitate to ask questions in our [discussions](https://github.com/filecoin-project/lotus/discussions) or reach out to [the maintainers](https://github.com/orgs/filecoin-project/teams/lotus-maintainers).

Thank you for contributing to Lotus!
Loading

0 comments on commit 6346cc6

Please sign in to comment.