Commit Graph

1506 Commits

Author SHA1 Message Date
Shane da Silva
3ac4e39c71 chore(shuttle): Release 0.5.2 (#2168)
## Why is this change needed?

Includeds some minor fixes that others are looking to use.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version of `@farcaster/shuttle` package to `0.5.2`
and includes enhancements for message processing and PostgreSQL schema
customization.

### Detailed summary
- Updated `@farcaster/shuttle` package version to `0.5.2`
- Added feature to handle removals for compact state explicitly and warn
on mismatching deletes
- Added feature to enable shuttle and its example-app to use a
PostgreSQL schema other than "public"

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.5.2
2024-07-12 17:11:21 +00:00
Varun Srinivasan
9d0f089746 chore: upgrade dockerfile to use node 22 (#2165)
## Why is this change needed?

Node 21 is not an LTS build and was used because we had issues with Node
20 on ARM.

Changing to using Node 22 will allow us to use only LTS builds, which
also solves issues with some dependencies like rimraf 6 explicitly
disallowing node 21.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the Node.js version in the Dockerfile and GitHub Actions
workflow to 22.4.1, ensuring compatibility and possibly leveraging new
features.

### Detailed summary
- Updated Node.js version in Dockerfile from 21.6 to 22.4.1
- Updated Node.js version in GitHub Actions workflow from 21 to 22

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-12 09:34:15 -07:00
Varun Srinivasan
5765fec186 chore: fix unhandled type error in tests (#2161)
## Why is this change needed?

Fixing this type error that started showing up in my local environment.
Unclear why it started triggering now, but the fix is to just cast it
and do the comparison.

There's a small edge case here that if the types were not strict
Uint8Arrays the tests might still pass. But that doesn't seem to be the
spirit of what we're testing here.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates a test file in `messageDataBytes.test.ts` to fix a
comparison issue in a test case related to decoding message data bytes.

### Detailed summary
- Fixed comparison issue in a test case by ensuring both sides are of
type Uint8Array.

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-11 21:09:49 -07:00
Cassandra Heart
a8b69a077c feat: make message processor handle removals for compact state explicitly, warn on mismatching deletes (#2141)
## Why is this change needed?

Follow up from review of #2124, we want to confirm first that moving the
responsibility of message processing marking messages as deleted for the
set difference from full-state-bearing messages is a no-op, and while
we're at it, might as well combine the potential thousands of SQL
updates into a single query.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces explicit handling of message removals for compact
state in the message processor, along with warnings for mismatching
deletes.

### Detailed summary
- Added handling for removals of compact state messages
- Warns on mismatching deletes
- Introduced new methods for processing compact state messages

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-11 23:09:13 -05:00
Varun Srinivasan
5e458b10ac chore: fix issues with repository setup (#2153)
## Why is this change needed?

Following the instructions to setup a repository resulted in errors.
This change:

- Adds CMake to setup instructions
- Requires Rust 1.77.0 locally since 1.78.0+ cause build errors
- Requires Rust 1.77.0 in CI for parity
- Requires Node 20+ locally for parity with CI
- Updates some README text for clarity

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update Node.js, Rust toolchains, and CI
configurations, ensuring consistency across environments. Additionally,
it enhances documentation clarity and fixes environment issues.

### Detailed summary
- Updated Node.js to version 20.11
- Updated Rust toolchain to version 1.77.0 for consistency
- Aligned CI configurations with local and Docker image setups
- Improved README.md for better understanding
- Fixed environment issue with running `yarn test` in shuttle

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-11 16:42:06 -07:00
Varun Srinivasan
fadd327506 chore: upgrade tsx to v4 (#2159)
## Why is this change needed?

Upgraded tsx to v4, was a drop in replacement. Verified by running a tsx
command for a benchmark.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates various `@esbuild` packages to version `0.21.5` across
different platforms. It also updates the `tsx` package to version
`4.16.2`.

### Detailed summary
- Updated `@esbuild` packages to `0.21.5` version
- Updated `tsx` package to `4.16.2` version

> The following files were skipped due to too many changes: `yarn.lock`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-11 10:09:36 -07:00
Varun Srinivasan
5656f327a4 chore: upgrade husky to v9 (#2158)
## Why is this change needed?

Upgrade husky dev dependency to v9

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates `husky` and `iconv-lite` dependencies, changes `husky`
version to `9.0.0`, and simplifies the `prepare` script.

### Detailed summary
- Updated `husky` dependency to version `9.0.11`
- Updated `iconv-lite` dependency to version `0.4.24`
- Simplified `prepare` script in `package.json` to just `"husky"`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-11 10:01:03 -07:00
Varun Srinivasan
3a8763145f chore: upgrade turborepo to v2 (#2156)
## Why is this change needed?

Upgrading turborepo to v2 using the [upgrade
guide](https://turbo.build/repo/docs/crafting-your-repository/upgrading#upgrading-to-20)

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates `turbo` package to version `2.0.6`, modifies
`turbo.json` structure, and upgrades other dependencies.

### Detailed summary
- Updated `turbo` package to `2.0.6`
- Restructured `turbo.json` file
- Updated `turbo` dependencies to version `2.0.6`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-10 22:16:26 -07:00
Varun Srinivasan
febc7837f9 chore: remove unnecessary foundry version pin in ci (#2155)
## Why is this change needed?

A foundry version was pinned in CI due to [this
bug](https://github.com/foundry-rs/foundry/issues/5749). it has been
fixed for almost a year now, so we don't need to do this anymore.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update the installation process in the CI
workflow by removing the pinned version of Foundry and installing
dependencies with `yarn`.

### Detailed summary
- Removed pinned version of Foundry installation in CI workflow
- Changed installation of dependencies to use `yarn install` command

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-10 21:47:28 -07:00
Ty Book
cc357b4b5c feat(shuttle): Make shuttle and example-app capable of using postgres schema other than "public" (#2149)
## Why is this change needed?

This allows using shuttle to target e.g. multi-tenant dbs. Shouldn't be
a breaking change because new parameters on public functions are
optional.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR enables `shuttle` and its `example-app` to use a custom
PostgreSQL schema.

### Detailed summary
- Added support for custom PostgreSQL schema in shuttle and example-app
- Updated migrations to create functions with `CREATE OR REPLACE`
- Updated dependencies in `package.json`
- Added dotenv package for environment variables
- Updated README with installation instructions for node 21
- Modified database client creation to include schema parameter
- Updated table row count estimation function to include schema
parameter

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-10 21:09:03 -07:00
Wasif Iqbal
e304f0b2c0 fix: force acknowledgement of no rewards for existing hubs (#2154)
## Why is this change needed?

- Force acknowledgement of no rewards for hubs that are already running 

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to add a prompt for hub operator agreement
before proceeding with hub startup.

### Detailed summary
- Added a function `prompt_for_hub_operator_agreement()` to handle
agreement prompt
- Introduced `update_env_file()` to update or create `.env` file with
agreement status
- Improved user interaction with clear messages and input validation
- Ensured hub operator agreement before executing hub-related commands

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-10 17:44:54 -05:00
Shane da Silva
1365f1f88e fix(shuttle): Fix resetting of batch flush logic when exceeding byte limit (#2151)
## Why is this change needed?

This results in the batch being flushed after each event since we don't
reset the count on flush.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version to 0.5.1, fixing a bug related to the reset
of the total batch bytes limit in `shuttle`.

### Detailed summary
- Updated version to 0.5.1
- Fixed reset of limit for total batch bytes in `hubSubscriber.ts`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.5.1
2024-07-10 20:12:28 +00:00
Shane da Silva
b1dc30a814 fix(shuttle): Fix example app to work with Shuttle 0.5.0+ (#2148)
## Why is this change needed?

Our build process didn't catch this. Will need to investigate
separately.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update dependencies and support clustering in
the `getWorker` and `getQueue` functions.

### Detailed summary
- Updated `@farcaster/shuttle` dependency to `^0.5.0`
- Added support for `Cluster` in `getWorker` function
- Added support for `Cluster` in `getQueue` function

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-10 08:23:30 -07:00
Shane da Silva
1320371c70 feat(shuttle): Allow changing subscriber batch size or flush interval (#2147)
## Why is this change needed?

The way we were writing events to the stream was resulting in a lot more
separate requests to Redis since we weren't actually batching them
together.

Change this so we leverage the multi-argument version of `XADD` so that
throughput can be increased at higher volumes. Accompanying this are the
introduction of a few more configuration options that allow us to tweak
the throughput of the `HubSubscriber`.

While here, do a minor version bump since we're slightly changing how
events are written to the stream.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `@farcaster/shuttle` package to version 0.5.0,
introducing customization for event batch size and time between flushes.

### Detailed summary
- Updated package version to 0.5.0
- Added customization for event batch size and time between flushes
- Modified event handling logic in `EventStreamHubSubscriber`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.5.0
2024-07-10 07:34:38 +00:00
Wasif Iqbal
17a81b7aaa chore: release 1.13.6 (#2146)
## Why is this change needed?

Release 1.13.6

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version of `@farcaster/hubble` to `1.13.6` and
includes various patches and features related to message delays,
snapshot bandwidth, hub service agreements, peer maps, clock skew
validation, and Rust extension updates.

### Detailed summary
- Added stats for bundle message delays and stale contact info
- Increased message threshold to reduce snapshot bandwidth usage
- Fixed cli arguments order issue in docker-compose.yml
- Added hub service agreement: no rewards for running a hub
- Added unique peer map to sync engine for active peers
- Validated gossip message for clock skew
- Updated Rust extension to curve25519-dalek 4.1.3

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/hubble@1.13.6
2024-07-09 19:17:57 -05:00
Sanjay
fa5eef4058 fix: Increase message threshold to reduce snapshot bandwidth usage (#2145)
## Why is this change needed?

Snapshots are using too much bandwitdh, increase the threshold to about
10% of current messages (~470M)

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
2024-07-10 00:09:14 +00:00
Wasif Iqbal
b5ff774a9c feat: add hub service agreement - there will be no rewards for running a hub (#2142)
## Why is this change needed?

⚠️ THERE WILL BE NO REWARDS FOR RUNNING A HUB

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.

<!-- start pr-codex -->

---

## PR-Codex overview
This PR adds a hub service agreement feature to the Hubble script,
requiring hub operators to agree to terms before starting the hub.

### Detailed summary
- Added function `prompt_for_hub_operator_agreement` to prompt hub
operators to agree to terms
- Prompt displays a warning about no rewards for running the hub
- Operators must type "Yes" to proceed
- Implemented input validation for agreement
- Integration of agreement prompt before starting or upgrading the hub

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-09 18:50:56 -05:00
Shane da Silva
6b037f48c0 chore(shuttle): Release 0.4.4 (#2140)
## Why is this change needed?

Includes a fix allowing Redis Clusters to be used with the `RedisClient`
class.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version of `@farcaster/shuttle` package to `0.4.4`
and introduces a new feature allowing the Redis client to be a cluster
instance.

### Detailed summary
- Updated `@farcaster/shuttle` package version to `0.4.4`
- Added feature: Redis client can now be a cluster instance

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.4.4
2024-07-09 14:35:07 -07:00
Shane da Silva
864261b798 feat(shuttle): Allow RedisClient's client to be a cluster instance (#2139)
## Why is this change needed?

We were artificially limiting the accepted type to a `Redis` instance,
when a `Cluster` instance would also work fine.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR adds support for Redis cluster instances in the `shuttle`
package.

### Detailed summary
- Added support for Redis cluster instances in `shuttle/redis.ts`
- Updated `RedisClient` constructor to accept either `Redis` or
`Cluster` client
- Updated `create` method to handle Redis cluster instances

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-09 14:21:06 -07:00
Shane da Silva
fcb76cd9ad chore(shuttle) Release 0.4.3 (#2136)
## Why is this change needed?

Releases a bug fix that is affecting Shuttle users.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version of `@farcaster/shuttle` package to `0.4.3`
and includes a patch to handle "no such key" error when querying group
on first start.

### Detailed summary
- Updated package version to `0.4.3`
- Patched to handle "no such key" error when querying group on first
start

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.4.3
2024-07-08 18:59:58 -07:00
Shane da Silva
d1500c007b chore: Update pull request template (#2135)
## Why is this change needed?

Our template is in need of a makeover. Made the following changes:

- Change **Motivation** to **Why is this change needed?** to emphasize
what we mean by Motivation.

- Remove the **Change Summary** section since this is automatically
summarized by PR-Codex bot.

- Remove requirement to sign commits, since this doesn't provide any
_real_ security and makes it slightly harder for contributors. Since
GitHub doesn't prevent them from creating the PR in the first place if
the HEAD commit isn't signed, we might as well allow it so we don't need
to manually bypass.

- Removed **Additional Context** section since this seemed superfluous.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR removes the `Change Summary` section from the pull request
template and updates the checklist options.

### Detailed summary
- Removed `Change Summary` section from PR template
- Updated checklist options in PR template

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-08 23:27:50 +00:00
Shane da Silva
2bae6fb98b chore: Update curve25519-dalek from 4.1.1 to 4.1.3 in Rust extension (#2134)
## Motivation

This addresses a vulnerability.

## Change Summary

Update

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `curve25519-dalek` package in the Rust extension of
the `@farcaster/hubble` addon from version 4.1.1 to 4.1.3.

### Detailed summary
- Updated `curve25519-dalek` package version from 4.1.1 to 4.1.3
- Removed `platforms` package
- Updated checksum for `curve25519-dalek` package

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 23:16:00 +00:00
aquatic
795815afbe fix(hubble): hub operator fid is not set docker compose (#2129)
## Motivation

Fixes #2088 #2117 

There is likely an underlying issue with the commander configuration but
this is a quick change that gets this working for those having trouble
getting the container up and running.

## Change Summary

Reordered CLI arguments in docker-compose.yml.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `docker-compose.yml` file for the
`@farcaster/hubble` app to fix an issue with CLI arguments order
affecting the hub operator FID.

### Detailed summary
- Added `--hub-operator-fid ${HUB_OPERATOR_FID:-0}` to fix unset hub
operator FID in docker-compose.yml.
- Rearranged CLI arguments to ensure correct order and parameter
assignment.

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-08 23:10:07 +00:00
Shane da Silva
4518058412 fix(shuttle): Handle missing group key (#2133)
## Motivation

We didn't handle the case where the group key wasn't already created.

## Change Summary

Handle it.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on gracefully handling "no such key" errors when
querying a group on the first start in the `shuttle` package.

### Detailed summary
- Added error handling for "no such key" scenario
- Skips group creation if key doesn't exist
- Improved robustness in handling ReplyError

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->

---------

Co-authored-by: Ken Goldfarb <hello@kengoldfarb.com>
2024-07-08 23:04:24 +00:00
dhairya1008
a7fdaa16e9 apps/hubble: fix docker-compose.yml warning (#2112)
"version is obsolelte"

Docker has made this line obsolete, no need to nention docker compose
version

## Motivation

Describe why this issue should be fixed and link to any relevant design
docs, issues or other relevant items.

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [ ] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [ ] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `docker-compose.yml` file for the `hubble` service
to use version 3.9 and the latest image `farcasterxyz/hubble:latest`.

### Detailed summary
- Updated `docker-compose.yml` to version 3.9
- Changed `hubble` service image to `farcasterxyz/hubble:latest`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->

Signed-off-by: dhairya1008 <parmar.dhairya1899@gmail.com>
Co-authored-by: dhairya1899 <17itdhairya.parmar@gmail.com>
2024-07-08 15:31:15 -07:00
Wasif Iqbal
4794a1afa0 chore: update statsd metrics for diff sync (#2132)
## Motivation

Describe why this issue should be fixed and link to any relevant design
docs, issues or other relevant items.

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [ ] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [ ] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on adding statistics tracking for different types of
sync messages in the `syncEngine.ts` file.

### Detailed summary
- Added statistics tracking for on-chain events, FNames, and messages
sync messages
- Incremented success, error, and deferred counts for each type of sync
message

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-08 12:06:17 -05:00
Wasif Iqbal
644f81d6de chore: batch info and error logs for message bundles (#2127)
## Motivation

Describe why this issue should be fixed and link to any relevant design
docs, issues or other relevant items.

## Change Summary

```
{"level":30,"time":1720293146285,"pid":90362,"hostname":"mbp.local","component":"Hub","0":"[event_id:453975843913728|farcaster_ts:110833945|fid:585630|hash:0xef173705c8f9c3843c4da43234e767582085e114|message_type:LINK_ADD|source:gossip]","1":"[event_id:453975843917824|farcaster_ts:110833945|fid:485354|hash:0xefba9d8b3f64469ffa5f3fd8c9907cf4f798d0cb|message_type:LINK_ADD|source:gossip]","2":"[event_id:453975843917825|farcaster_ts:110833945|fid:192373|hash:0x0ae9d1dce72f77f9228c0e39c70d4eac62a7442f|message_type:LINK_ADD|source:gossip]","3":"[event_id:453975843917826|farcaster_ts:110833945|fid:633096|hash:0xef823130e0b0e85821c942f518d5030f413cb1be|message_type:LINK_ADD|source:gossip]","4":"[event_id:453975843917827|farcaster_ts:110833945|fid:746504|hash:0xcc682a388d3ff1fa9f1c488afe34bc1eef5c0f7c|message_type:LINK_ADD|source:gossip]","5":"[event_id:453975843917829|farcaster_ts:110833945|fid:190012|hash:0x300a529843da3add0560c0c8be228b69d2628883|message_type:LINK_ADD|source:gossip]","6":"[event_id:453975843917828|farcaster_ts:110833945|fid:579583|hash:0xbf9ebf245dcf7173e7a3622f0a99f974688c3540|message_type:CAST_REMOVE|source:gossip]","7":"[event_id:453975843917830|farcaster_ts:110833945|fid:711341|hash:0x9ffd88aa81af70d6602f819f7a8b2ad76c17f165|message_type:CAST_ADD|source:gossip]","8":"[event_id:453975843921920|farcaster_ts:110833945|fid:270138|hash:0xd26ff734375c0a6a4804a14f042d06ae3fa0e241|message_type:CAST_ADD|source:gossip]","9":"[event_id:453975843921921|farcaster_ts:110833946|fid:305198|hash:0x50111086f8f27d4a7c080e48f20c287ba71a2dbb|message_type:CAST_ADD|source:gossip]","10":"[event_id:453975843921922|farcaster_ts:110833945|fid:3863|hash:0x60beb24804fe0df885fc251b88ac4f4d7e19e0d3|message_type:CAST_ADD|source:gossip]","11":"[event_id:453975843971072|farcaster_ts:110833945|fid:549607|hash:0xec82139fcad13947ef05c6d04d128897c5eefaf8|message_type:REACTION_ADD|source:gossip]","12":"[event_id:453975843971073|farcaster_ts:110833945|fid:265048|hash:0x2d872242ca0d99b8292e4ff7444440694f0afac9|message_type:REACTION_ADD|source:gossip]","13":"[event_id:453975843975168|farcaster_ts:110833945|fid:563445|hash:0xdedd26fb91e8cea03444386f204dadbf28fbbc20|message_type:REACTION_ADD|source:gossip]","14":"[event_id:453975843975169|farcaster_ts:110833945|fid:522942|hash:0x5ecea1832c45f0dea07a5e7db7ee9ababe065385|message_type:REACTION_ADD|source:gossip]","15":"[event_id:453975843975170|farcaster_ts:110833945|fid:520558|hash:0x987f67b9052d37bda525498d85ab2658e551a6b0|message_type:REACTION_ADD|source:gossip]","16":"[event_id:453975843975171|farcaster_ts:110833946|fid:651987|hash:0xe100174210580b70893107eadd1475e871b0ff27|message_type:REACTION_ADD|source:gossip]","17":"[event_id:453975843975172|farcaster_ts:110833945|fid:511684|hash:0x72561ecda54162bb31b7e234cdee3aafc065a067|message_type:REACTION_ADD|source:gossip]","18":"[event_id:453975843975173|farcaster_ts:110833945|fid:563445|hash:0x174b2b29e616c0dc351169a46d0d1a115ce0fe45|message_type:REACTION_ADD|source:gossip]","19":"[event_id:453975843975174|farcaster_ts:110833945|fid:370971|hash:0x7fbd427e27b8718c700466f437b994c04bd6bcc1|message_type:REACTION_ADD|source:gossip]","20":"[event_id:453975843979264|farcaster_ts:110833945|fid:306729|hash:0x9bca22a42956566cbdb7b2de7471ba91ee4a976d|message_type:REACTION_ADD|source:gossip]","21":"[event_id:453975843979265|farcaster_ts:110833945|fid:521421|hash:0x58855581f5a4a2f1a673af6c235fbb7a039616a3|message_type:REACTION_ADD|source:gossip]","22":"[event_id:453975843979266|farcaster_ts:110833945|fid:509854|hash:0x19f48b1c2113b400e37200be1383a92170b02909|message_type:REACTION_ADD|source:gossip]","23":"[event_id:453975843979267|farcaster_ts:110833945|fid:516301|hash:0xd4c626df0a29c2ea3e71872caa1c0f84dda5b62a|message_type:REACTION_ADD|source:gossip]","24":"[event_id:453975843979268|farcaster_ts:110833945|fid:337423|hash:0x9eb8d64713a79f6ed5983004fcdbb4667bf39a82|message_type:REACTION_ADD|source:gossip]","msg":"successful submit messages"}
```

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [ ] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [ ] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to enhance logging in the `Hub` class by
capturing successful and failed message submissions.

### Detailed summary
- Added `errorLogs` and `infoLogs` arrays for storing error and info
logs respectively
- Enhanced logging for successful and failed message submissions with
detailed information
- Added logging for successful and failed message submissions

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-06 14:24:34 -05:00
Wasif Iqbal
4055f7001e chore: update cleanup interval for active peers (#2123)
## Motivation

Describe why this issue should be fixed and link to any relevant design
docs, issues or other relevant items.

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [ ] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [ ] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR adjusts the cleanup interval for the Peer TTLMap in the sync
engine from 36 hours to 25 hours.

### Detailed summary
- Adjusted the cleanup interval for the Peer TTLMap from 36 hours to 25
hours

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-05 15:26:05 -05:00
Wasif Iqbal
b6bad85b8a fix: update start time to farcaster time when submitting message bundles from sync (#2121)
## Motivation

Describe why this issue should be fixed and link to any relevant design
docs, issues or other relevant items.

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to replace the usage of `Date.now()` with
`getFarcasterTime().unwrapOr(0)` in `syncEngine.ts` for more accurate
time tracking during message bundle submission.

### Detailed summary
- Replaced `Date.now()` with `getFarcasterTime().unwrapOr(0)` for
startTime in `syncEngine.ts`
- Improved accuracy in time tracking during message bundle submission.

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-03 12:13:10 -05:00
osrm
02dddc269d fix: corrected typo errors in CHANGELOG.md (#2109)
Corrected typos, 

## Motivation

Describe why this issue should be fixed and link to any relevant design
docs, issues or other relevant items.

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [ ] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [ ] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the CHANGELOG for the Hubble app version 1.13.2. It
includes fixes for HTTP endpoint responses and IP address fetching.

### Detailed summary
- Fixed HTTP endpoint response wording
- Improved IP address fetching by preferring IPv4 addresses

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-03 11:49:36 -05:00
Wasif Iqbal
2a82b3dcd6 feat: add unique peer map to sync engine to represent current active peers (#2120)
## Motivation

- Current peer store keeps track of all hubs that successfully connected
- However, peers may connect and never be seen again due to churn or
change in Peer ID
- We add TTL Map of peers that only adds peers, never deletes, and
expires any peer that hasn't gossiped updates in 24 hours

## Change Summary

- add unique peer map to sync engine to represent current active peers

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a unique peer map to track active peers in the sync
engine of the Hubble app. It also adds a high-performance TTLMap for
efficient entry expiration management.

### Detailed summary
- Added unique peer map for active peers in the sync engine
- Implemented TTLMap for automatic expiration of entries
- Updated handling of peer discovery events
- Enhanced peer contact management in the sync engine

> The following files were skipped due to too many changes:
`apps/hubble/src/utils/ttl_map.ts`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-03 11:48:57 -05:00
Sergei Volkov
094fe86f06 fix(docs): corrected errors in installation instructions (#2087)
Fixes issue #2086 

## Motivation

Due to errors or outdated information in the Farcaster Hub installation
guides, the Hub cannot be synchronized due to lack of memory which will
prevent it from starting and working correctly. This error is very
important because it creates difficulties for new users at the very
initial stage of work and familiarization with Farcaster Hub

## Change Summary

Changes have been made regarding the minimum amount of memory required
for Farcaster Hub to work correctly. The old value is 60 GB in the GCP
installation guide and 140 GB is the old value in the main installation
guide. Farcaster Hub currently takes up about 150 GB. The old memory
values have been changed to 160 GB, which allows you to run the Hub and
have a reserve of correct operation for a period of time

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [ x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [ x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

According to the GCP guide we create a virtual server and set the server
parameters via Google Cloud Console by copying the data from the guide
into the created file "main.tf"
![1
screenshot](https://github.com/farcasterxyz/hub-monorepo/assets/80642652/ae6bbd6e-a3ee-4129-978d-896d932d8c35)

The virtual server has been configured with these memory settings
![2
screenshot](https://github.com/farcasterxyz/hub-monorepo/assets/80642652/ae81634a-d66f-436f-a107-5417f26cf4b4)

Then after running the script specified in the main installation guide
on the created server Hub starts synchronization, but after a while it
stops with the error "code 2".
![3
screenshot](https://github.com/farcasterxyz/hub-monorepo/assets/80642652/3696c741-1234-4834-8218-ed71c179e1af)

This error means that Hub cannot continue synchronization due to lack of
memory
![4
screenshot](https://github.com/farcasterxyz/hub-monorepo/assets/80642652/57aa5e65-b419-4385-ba5c-ca678c4bb60a)

Warpcast: @vsu 

<!-- start pr-codex -->

---

## PR-Codex overview
This PR increases the disk size for the Ubuntu 20.04 LTS image in the
GCP tutorial and adjusts the storage requirement to 160 GB in the
installation guide.

### Detailed summary
- Increased disk size for Ubuntu 20.04 LTS image to 160 GB in GCP
tutorial
- Adjusted storage requirement to 160 GB in the installation guide

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-02 21:04:40 -05:00
Wasif Iqbal
aa02a48db4 fix: validate gossip message for clock skew (#2119)
## Motivation

- Messages were found in gossip with very high timestamps that would be
very far in the future

## Change Summary

- Reject gossip messages that are more than 10 minutes in the future 

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on fixing clock skew validation for gossip messages in
the `@farcaster/hubble` module.

### Detailed summary
- Added validation for clock skew in gossip messages
- Introduced `ALLOWED_CLOCK_SKEW_SECONDS` constant
- Improved error handling for future timestamps in gossip messages

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-02 21:03:18 -05:00
Wasif Iqbal
fdcc3b5228 chore: add stats for bundle message delays, stale contact info (#2118)
## Motivation

- Need better visibility into message delays and disambiguate between
bundle delay and message delay
- Ensure stale contacts aren't disseminating through the network

## Change Summary

- Add statsd metrics for earliest and latest message timestamp in bundle
and bundle creation timestamp. All timestamps are in farcaster time
- Add statsd metric for old contact info being gossiped

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing message bundle submission in the Hubble
application by adding stats for message delays and contact info
staleness.

### Detailed summary
- Added stats for bundle message delays and stale contact info
- Updated `submitMessageBundle` method parameters in multiple files
- Updated `submitMessageBundle` method in `Hub` class to include
additional stats and parameters

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-07-02 19:05:18 -05:00
Wasif Iqbal
59bcfe7fba chore: release 1.13.5 (#2114)
## Motivation

- Reduce network bandwidth with gossip improvements
- Support experimental sync APIs (note: may be removed or significantly
altered in the future)

## Change Summary

- Update p2p gossip to reduce unnecessary contact updates
- Add experimental sync control APIs

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates versions and adds endpoints for sync control in
`hub-web` and `hub-nodejs`, and includes various improvements and fixes
in the `hubble` app.

### Detailed summary
- Updated `hub-web` version to 0.8.12
- Updated `hub-nodejs` version to 0.11.19
- Added endpoints for sync control
- Improved gossip contact info frequency in `hubble` app
- Added experimental HTTP APIs for sync control in `hubble` app

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/hubble@1.13.5 @farcaster/hub-nodejs@0.11.19 @farcaster/hub-web@0.8.12
2024-06-30 17:05:49 -05:00
Wasif Iqbal
224e75fa6b fix: contact info updates (#2113)
## Motivation

Contact info gossip is causing undue burden on network 

## Change Summary

fix: gossip contact info every 30 minutes instead of every minute, avoid
gossiping contact info on peer connect, skip contact info updates that
happen too frequently

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on optimizing contact info gossiping in the Hubble app
by reducing frequency and skipping recent updates.

### Detailed summary
- Changed gossip contact info frequency to every 30 minutes
- Skipped gossiping contact info on peer connect
- Added a threshold to skip contact info updates happening too
frequently

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-30 15:03:42 -05:00
Wasif Iqbal
667a5b304c feat: add experimental HTTP APIs to control sync (#2111)
## Motivation

Add HTTP APIs to force sync with a particular peer id and to interrupt
current sync.

NOTE: This is experimental, these endpoints may be removed or
significantly altered in the future.

## Change Summary

### GET /v1/syncStatus

```
{
  "isSyncing": true,
  "syncStatus": [
    {
      "peerId": "12D3KooWDgi3EZGdsghsuyk17QUJUm81WdypjUfUpQFMv1KHqFPg",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452062847,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWBeHgpW1YJer1exohYJmBugcCxw6nPivDWPinc7GzZwtW",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452193687,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWBM99sMoBfWZdA8eDMbU6z2awAKvnpwPWfsrJEkK6gE82",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452066054,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWAd4CS8JrFzhavbX8VYoqZgYvixq92SKoMwkKSmEYn3ji",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 451854112,
      "ourMessages": 449263973,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWAceovMknjAkFVxsazdq1zFsBA1FdQcd9quq8szhmi4YG",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452123129,
      "ourMessages": 449263973,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooW9zRXheJk13bPxxGzsDqK9WjienqoeQTpZq1kh3hbi8vs",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452386192,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWAiWjWtt29EgQtANUPtZLmXrwermBf1PFvHtSkrkfWuVN",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 451970452,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWET8RWKH5nRGmGn7FWMkSP5p8E48ipSoqC8CdCrCKekhh",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452125619,
      "ourMessages": 449263973,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWEFY9y65Su3LFd68BuJ3GLD37KxczMxxJ2h3QX3FsrTMw",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452009411,
      "ourMessages": 449263973,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWAg56TGduGdNjCtuXEdLkiyuTQykjBsKLmnBhKx2WvMgU",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452250942,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWCw6zzXy2zeXgHj1jhPruUaqjfbNxK8Gp6hGoaA17ReYf",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452077312,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWELYvHd5MkDYaT1BXCEVn61PuznAj15mUmQn1ioLVQC1h",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452160134,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWDvzJMYFAzdJ4NPtHfm4Ygoz9JSWXgi346q5VAE6stnSm",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452012326,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWBCbzwWTYkU7hzQHo8dN2PTYtoom8Eo3heP1QtuuaYbPy",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452241704,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWC4LJ62SHpTVoSvyzA63jBHXeTNm1vboKUygR83d8EH5X",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452097420,
      "ourMessages": 449266923,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWBuS8TUiqeabs9YKTz17vQRD2csVA4PDUqFFmKDyCGepq",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 451996803,
      "ourMessages": 449264141,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWMRrDr4JmWFnxusb5S9nsrkxBAXqWf7BymJtgQRsJMVQ2",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452267236,
      "ourMessages": 449264141,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWB8uy9VxTpipGoRjEc2BFoswXKgyGS6rhNTd1ofD9JXLG",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452081457,
      "ourMessages": 449267092,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWDrDvLLvRNaUiqmrA9YvRp41gZaEmoatqVAdJwzopdgBN",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 452128777,
      "ourMessages": 449264141,
      "lastBadSync": -1,
      "score": 0
    },
    {
      "peerId": "12D3KooWBfPafShMrDwmVwM1qGqajyyYnfsr4K2MznKRfnxx6giU",
      "inSync": "false",
      "shouldSync": false,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 451763652,
      "ourMessages": 449264184,
      "lastBadSync": -1,
      "score": 0
    }
  ],
  "engineStarted": true
}
```

### POST /v1/stopSync
```
{
  "isSyncing": false,
  "syncStatus": [],
  "engineStarted": true
}
```

### POST /v1/forceSync?peer_id=${PEER_ID_HERE}
```
{
  "isSyncing": true,
  "syncStatus": [
    {
      "peerId": "12D3KooWRnSZUxjVJjbSHhVKpXtvibMarSfLSKDBeMpfVaNm1Joo",
      "inSync": "false",
      "shouldSync": true,
      "divergencePrefix": "",
      "divergenceSecondsAgo": 0,
      "theirMessages": 448940578,
      "ourMessages": 449276683,
      "lastBadSync": -1,
      "score": 0
    }
  ],
  "engineStarted": true
}
```

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to add experimental HTTP APIs for controlling
synchronization in the `@farcaster/hubble` app.

### Detailed summary
- Added experimental HTTP APIs for controlling sync: `stopSync`,
`syncStatus`, `forceSync`
- Implemented corresponding API endpoints in `httpServer.ts`
- Updated documentation with examples and responses for each API

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-29 01:37:30 -05:00
Sanjay
c723f655ff feat: add endpoints to control sync (#2110) 2024-06-28 17:30:45 -07:00
Shane da Silva
e67f8cb0dd chore(shuttle): Release 0.4.2 (#2108)
## Motivation

Release latest fix.

## Change Summary

Updates version to 0.4.2

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version of `@farcaster/shuttle` package to `0.4.2`
and includes a more efficient switch clause implementation.

### Detailed summary
- Updated version to `0.4.2` in `packages/shuttle/package.json`
- Improved efficiency of switch clause in the code

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.4.2
2024-06-27 13:31:10 -07:00
Shane da Silva
fad0f17916 fix(shuttle): Use more efficient lookup to avoid errors (#2107)
## Motivation

We were seeing errors due to the number of message hashes in the `IN`
clause, resulting in a different prepared statement for each different
number of hashes.

## Change Summary

Switch to using the `= any([...])` form so that the same prepared
statement is always used.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on optimizing the `shuttle` package by updating
dependencies and improving query efficiency.

### Detailed summary
- Updated `pg` dependency to `8.12.0`
- Switched `where` clause in `MessageReconciliation` for more efficiency
- Added `sql` import in `shuttle/db.ts`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-27 13:21:11 -07:00
Sanjay
fb54ef89bb fix(shuttle): Bump max receive size to fix resource exhaustion error (#2106)
## Motivation

Stream processing was halting due to:

```
Hub event stream processing halted 8 RESOURCE_EXHAUSTED: Received message larger than max (5086178 vs 4194304)
```

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the Shuttle package to version 0.4.1, fixing a resource
exhaustion error and increasing the maximum receive size.

### Detailed summary
- Updated Shuttle package version to 0.4.1
- Increased maximum receive message length to 10mb
- Fixed resource exhaustion error

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/shuttle@0.4.1
2024-06-27 19:43:59 +00:00
Sanjay
00d88c6f7f chore: Release 1.13.4 (#2104)
## Motivation

Release performance fixes for gossip

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the version of `@farcaster/hubble` to `1.13.4` in the
package.json and includes patch changes related to fixing issues with
mainnet bootstrap peers and gossip worker.

### Detailed summary
- Updated version to `1.13.4`
- Removed `nemes` from mainnet bootstrap peers
- Fixed gossip worker spending too much time iterating peer store

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/hubble@1.13.4
2024-06-26 16:00:11 -07:00
Sanjay
366ce95c31 fix: Fix gossip worker spending too much time iterating peer store (#2103)
## Motivation

```
 [Bottom up (heavy) profile]:
  Note: percentage shows a share of a particular caller in the total
  amount of its parent calls.
  Callers occupying less than 1.0% are not shown.

   ticks parent  name
  1460430   43.7%  /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  795879   54.5%    /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  224383   28.2%      LazyCompile: *peerIdFromBytes file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-id/dist/src/index.js:153:32
  224365  100.0%        LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
  224365  100.0%          /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  174182   21.9%      LazyCompile: *load file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:35:15
  174145  100.0%        /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  90942   11.4%      LazyCompile: *decode file:///home/sanjay/hubble_dev/node_modules/multiformats/src/bases/base.js:343:12
  90931  100.0%        LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
  90931  100.0%          /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  79173    9.9%      /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  27262   34.4%        LazyCompile: *cleanPath file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/node_modules/@multiformats/multiaddr/dist/src/codec.js:165:26
  27252  100.0%          LazyCompile: *bytesToMultiaddrParts file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/node_modules/@multiformats/multiaddr/dist/src/codec.js:56:38
  27235   99.9%            LazyCompile: *load file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:35:15
  15786   19.9%        LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
  15786  100.0%          /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
    879    5.6%            LazyCompile: *forEach file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/index.js:24:18
  12903   16.3%        LazyCompile: *format file:///home/sanjay/hubble_dev/node_modules/multiformats/src/cid.js:20:23
  12886   99.9%          LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
  12886  100.0%            /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  10342   13.1%        LazyCompile: *peerIdFromBytes file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-id/dist/src/index.js:153:32
  10341  100.0%          LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
  10341  100.0%            /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
   7094    9.0%        LazyCompile: *bytesToMultiaddrParts file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/node_modules/@multiformats/multiaddr/dist/src/codec.js:56:38
   7092  100.0%          LazyCompile: *load file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:35:15
   7092  100.0%            /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
   3885    4.9%        LazyCompile: *_peerIdToDatastoreKey file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:21:26
   3883   99.9%          LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
   3883  100.0%            /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
  38786    4.9%      LazyCompile: *fromString file:///home/sanjay/hubble_dev/node_modules/uint8arrays/dist/src/from-string.js:10:27
  24315   62.7%        LazyCompile: *Key file:///home/sanjay/hubble_dev/node_modules/interface-datastore/dist/src/key.js:29:16
  24275   99.8%          LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
  24275  100.0%            /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
   7340   18.9%        LazyCompile: *_peerIdToDatastoreKey file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:21:26
   7338  100.0%          LazyCompile: *all file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/dist/src/store.js:170:15
   7338  100.0%            /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
   7110   18.3%        LazyCompile: *_allKeys file:///home/sanjay/hubble_dev/node_modules/datastore-core/dist/src/memory.js:32:14
   7110  100.0%          /home/sanjay/.nvm/versions/node/v18.15.0/bin/node
   7010   98.6%            LazyCompile: *next file:///home/sanjay/hubble_dev/node_modules/it-peekable/dist/src/index.js:17:15
     98    1.4%            Function: ^next file:///home/sanjay/hubble_dev/node_modules/it-peekable/dist/src/index.js:17:15
  25814    3.2%      LazyCompile: *toString file:///home/sanjay/hubble_dev/node_modules/uint8arrays/dist/src/to-string.js:9:25
  24662   95.5%        LazyCompile: *bytes2mh file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/node_modules/@multiformats/multiaddr/dist/src/convert.js:188:18
  24661  100.0%          LazyCompile: *bytesToMultiaddrParts file:///home/sanjay/hubble_dev/node_modules/@libp2p/peer-store/node_modules/@multiformats/multiaddr/dist/src/codec.js:56:38

```

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on optimizing the performance of the `peerStoreCount`
function in the `gossipNodeWorker.ts` file by addressing the issue of
blocking the event loop.

### Detailed summary
- Added a comment highlighting the performance-intensive nature of
`peerStoreCount` function
- Removed redundant `statsd().gauge` call in `handleContactInfo` method

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-26 15:32:49 -07:00
Wasif Iqbal
3f0fb85c15 fix: remove nemes from mainnet bootstrap peers (#2102) 2024-06-26 14:53:53 -05:00
Sanjay
2bf0959f2e chore: Release 1.13.3 (#2091)
## Motivation

Release 1.13.3

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers
@farcaster/hubble@1.13.3 @farcaster/hub-nodejs@0.11.18 @farcaster/core@0.14.17
2024-06-24 23:49:12 +00:00
Sanjay
b150e90001 fix: Use stricter socket timeout for gossip (#2090)
## Motivation

Gossip metrics indicate the worker sometimes stalls for 5 mins before
receiving messages in a burst. Likely due to one or more bad peers. The
default socket timeout is 5 mins, set this to 30seconds to see if it
helps.

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `hubble` package to use a stricter socket timeout
for gossip communication in the `gossipNodeWorker.ts` file.

### Detailed summary
- Updated the socket timeout for gossip communication to be stricter (30
seconds).
- Modified the `transports` configuration to include the new socket
timeout settings.

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-24 16:17:56 -07:00
Shane da Silva
2e0779161b fix: Ensure we run yarn postinstall script for production build (#2089)
## Motivation

We were still missing the patch in production.

## Change Summary

Ensure we run `postinstall` in production as well.

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on optimizing the Docker build process by adding a `yarn
postinstall` step after installing production dependencies.

### Detailed summary
- Added `yarn postinstall` step after installing production dependencies
in the Dockerfile.

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-24 18:00:40 +00:00
Wasif Iqbal
eacf29c98c fix: return better error message (#2077)
## Motivation

Parameters that contained invalid cast URLs with valid cast URL prefixes
were surfacing database error instead of not found error. The url itself
did not contain parent casts, but because it contained a valid prefix,
the database lookups were returning errors.
For example, a valid URL may be:
"https://warpcast.com/~/channel/japan777iine"
An invalid URL may be: "https://warpcast.com/~/chanel-makeup"

Since both URLs contain same prefix, _part_ of the invalid param gets
processed. That "prefix" then yields an error when entries aren't found
in the database. However, no entries found is expected, because the URL
is garbage.

Instead of surfacing the database error, we now correctly surface not
found error. This should fix #2067

- Certain queries to Hub API caused db errors to surface, e.g:
```
{
  "code": 2,
  "details": "db.internal_error/could not get message with key: [1, 129, 11, 134, 0, 1, 111, 110, 101, 6, 78, 209, 172, 203, 162, 11, 104, 228, 239, 164, 151, 212, 243, 3, 81, 109, 55, 199, 100, 32]",
  "metadata": {
    "errcode": [
      null
    ]
  }
}
```

## Change Summary

**Empty URL**
```
{
  "errCode": "bad_request.invalid_param",
  "presentable": false,
  "name": "HubError",
  "code": 3,
  "details": "url < 1 byte",
  "metadata": {
    "errcode": [
      "bad_request.invalid_param"
    ]
  }
}
```

**Invalid URL**
```
{
  "errCode": "not_found",
  "presentable": false,
  "name": "HubError",
  "code": 2,
  "details": "could not get message with key: [1, 129, 11, 134, 0, 1, 111, 110, 101, 6, 78, 209, 172, 203, 162, 11, 104, 228, 239, 164, 151, 212, 243, 3, 81, 109, 55, 199, 100, 32]",
  "metadata": {
    "errcode": [
      "not_found"
    ]
  }
}
```

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to fix the issue where the HTTP endpoint returns
"not found" instead of an internal database error.

### Detailed summary
- Fixed the issue in the `cast_store.rs` file related to generating
message primary key
- Updated error handling in `message.rs` and `store.rs` files
- Added a new function `not_found` in `store.rs`
- Modified error conversion logic in `server.ts` to handle Rust errors

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-21 18:59:23 -05:00
Aditi Srinivasan
2d26d3051b cli tool for computing sync health and exploring causes for message diffs (#2073)
## Motivation

We want a better metric than current number of messages (i.e. "sync
percent") for measuring sync health. It doesn't account for the fact
that there are valid reasons for temporary displacements in message
counts (i.e. compaction, small network delays). Instead, we want to take
some chunk of time in the past and count up messages in that chunk and
compare the counts as a somewhat more evolved sync metric.

## Change Summary

CLI command that computes sync health between one node and peers,
explores nonzero diffs, and prints out summarized, structured output.

```
❯ node build/cli.js sync-health --max-num-peers 50 --primary-node lamia.farcaster.xyz:2283 --start-time-ofday 11:30:00 --stop-time-ofday 11:35:00
❯ cat health.out  |  jq
{
  "startTime": "2024-06-21T15:15:00.000Z",
  "stopTime": "2024-06-21T15:17:00.000Z",
  "primary": "hoyt.farcaster.xyz:2283",
  "peer": "84.247.160.59:2283",
  "primaryMessageCount": 5311,
  "peerMessageCount": 4930,
  "diff": 381,
  "diffPercentage": 0.0717379024665788,
  "numSuccessToPeer": 378,
  "numErrorToPeer": 6,
  "successTypesToPeer": [
    null,
    3,
    2,
    6
  ],
  "errorMessagesToPeer": [
    "no storage",
    "invalid signer: signer 0x02c2f67b36cec88270462f95d7c553d13bc339be61c02db591c9144fcf2592dd not found for fid 681926"
  ],
  "numSuccessToPrimary": 0,
  "numErrorToPrimary": 0,
  "successTypesToPrimary": [],
  "errorMessagesToPrimary": []
}
```

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [x] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a CLI tool `hubble` for measuring sync health. It
includes commands to measure sync health and calculates message
statistics between nodes.

### Detailed summary
- Added `sync-health` command to measure sync health
- Introduced classes for message stats and sync health stats
- Implemented functions to query message counts and compute stats
- Added functions to pick peers and compute sync IDs

> The following files were skipped due to too many changes:
`apps/hubble/src/utils/syncHealth.ts`

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2024-06-21 16:58:23 -07:00
Sanjay
ff4ec34429 chore: Release 1.13.2 (#2081)
## Motivation

Release 1.13.2

## Change Summary

Describe the changes being made in 1-2 concise sentences.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.
- [x] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

If this is a relatively large or complex change, provide more details
here that will help reviewers


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update package versions and dependencies
across multiple repositories.

### Detailed summary
- Updated package versions to `0.14.16`, `0.8.11`, `0.11.17`, `0.4.0`,
`1.13.2`
- Updated dependencies in various packages
- Added rpc to expose `LinkCompactStateMessage` with explicit handling
of type

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
@farcaster/hubble@1.13.2 @farcaster/core@0.14.16 @farcaster/hub-nodejs@0.11.17 @farcaster/hub-web@0.8.11 @farcaster/shuttle@0.4.0
2024-06-21 16:17:36 -07:00