Commit Graph

1535 Commits

Author SHA1 Message Date
Sanjay
f1d80deb01 chore: Release 1.14 (#2208)
## Why is this change needed?

Release 1.14

## 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.14.0`,
introduces minor and patch changes, and updates the `FARCASTER_VERSION`
constant in `hubble.ts`.

### Detailed summary
- Updated `@farcaster/hubble` version to `1.14.0`
- Minor and patch changes in `CHANGELOG.md`
- Updated `FARCASTER_VERSION` constant in `hubble.ts`

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

<!-- end pr-codex -->
@farcaster/hubble@1.14.0
2024-07-24 15:29:50 -07:00
Cassandra Heart
d1dce89fc9 fix: do not let deleted fname events allow old fname events to be re-added (#2203)
## Why is this change needed?

The fname events are not coming through correctly for a few names, and
by consequence we're seeing a few old fname events being endlessly
replayed. The deletion of the fname record (when fid = 0 in proof)
completely removes the record rather than its association with a fid,
and by consequence replaying the older event re-adds the fname. This
resolves the hub side of the behavior by correctly holding on to the new
fname event, but deleting the association with a fid.

## 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
The focus of this PR is to enhance the `hubble` app by fixing issues
related to username proof handling and syncing historical events.

### Detailed summary
- Fixed issue where deleted fname events allowed re-adding old fname
events
- Improved syncing historical events in `syncEngine.ts`
- Updated `mergeUserNameProof` functionality in tests
- Added `rsGetUserNameProof` import in `nameRegistryEvent.ts`
- Enhanced `UserDataStore` functionality in `user_data_store.rs`

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

<!-- end pr-codex -->
2024-07-24 14:48:28 -07:00
Sanjay
a5f867fbcb fix: Fix incorrect target fid check for link messages older than the compact state (#2207)
## Why is this change needed?

We were checking for the message creator's fid instead of the target fid
and therefore rejecting valid messages older than the compact state

## 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 fixes an issue with target fid check for link messages older
than the compact state in the `store.rs` file and adds tests in
`linkStoreCompactState.test.ts`.

### Detailed summary
- Fixed incorrect target fid check for link messages in `store.rs`
- Added tests for merging link add messages in
`linkStoreCompactState.test.ts`

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

<!-- end pr-codex -->
2024-07-24 14:35:37 -07:00
Sanjay
554d82a45b [fix] Fix race condition with earliest ts hash calculation (#2204)
## Why is this change needed?

It was possible to trigger race conditions when calculating
earliest_ts_hash, this led to hubs have different values which meant
that stores would become out of sync. Migrate the cache to rust and
prevent race conditions.


## 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 migrates the storage cache to Rust and addresses a race
condition.

### Detailed summary
- Migrated storage cache to Rust for efficiency
- Fixed a race condition in the storage cache
- Added `PRIMARY_KEY_LENGTH` constant in `message.rs`
- Updated `storage_cache` exports in `store/mod.rs`
- Added functions to interact with storage cache in `utils.rs`
- Updated `lib.rs` to include `StorageCache`
- Updated `storeEventHandler.ts` to handle `StorageCache`
- Updated tests to use `StorageCache` in `storeEventHandler.test.ts`
- Implemented `StorageCache` in `store_event_handler.rs`
- Added Rust bindings for `StorageCache` in `rustfunctions.ts`

> The following files were skipped due to too many changes:
`apps/hubble/src/storage/stores/storageCache.ts`,
`apps/hubble/src/storage/stores/storageCache.test.ts`,
`apps/hubble/src/addon/src/store/storage_cache.rs`

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

<!-- end pr-codex -->
2024-07-23 20:50:30 -07:00
Cassandra Heart
be54d20352 fix: full state events should not include deletes (#2124)
## Why is this change needed?

The current processing of full state events results in an unbounded
number of deleted messages, making event consumption downstream
unpredictable and prone to getting stuck on singular large events.
Because merge events historically applied to deltas, and deltas were
generally small in effect size, this was a reasonable consideration, but
for full state (compact) messages, it is implicit on what is added
(everything in it) and what is not (everything not in it), making the
deleted messages something implicitly handled by downstream consumers.

## 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 focuses on fixing the behavior of full state events in the
`store.rs` file and test cases related to compact state messages in the
`linkStoreCompactState.test.ts`.

### Detailed summary
- Fixed full state events to exclude deleted messages in `store.rs`
- Updated test cases to reflect changes in handling deleted messages for
compact state messages in `linkStoreCompactState.test.ts`

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

<!-- end pr-codex -->
2024-07-19 12:36:25 -05:00
Wasif Iqbal
3746a4847a chore: release 1.13.8 (#2199)
## Why is this change needed?

- release 1.13.8

## 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
The focus of this PR is to update version numbers and dependencies
across various packages.

### Detailed summary
- Updated version to `0.14.19` in `@farcaster/core`
- Updated version to `0.11.21` in `@farcaster/hub-nodejs`
- Updated version to `0.5.7` in `@farcaster/shuttle`
- Updated version to `1.13.8` in `@farcaster/hubble`
- Added event id functions in `@farcaster/core`
- Fixed conflict criteria issue in `@farcaster/shuttle`
- Upgraded libp2p to `0.44.0` in `@farcaster/hubble`
- Increased hub storage requirement to `200 GB` in `@farcaster/hubble`

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

<!-- end pr-codex -->
@farcaster/hubble@1.13.8 @farcaster/hub-nodejs@0.11.21 @farcaster/shuttle@0.5.7 @farcaster/core@0.14.19
2024-07-18 16:14:32 -05:00
Wasif Iqbal
ba79e46afc fix: ack script (#2198)
## Why is this change needed?

- fix: remove parentheses for prompt, which causes changes to occur in
sub shell and are not persisted to the environment file

## Merge Checklist

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
2024-07-18 20:43:27 +00:00
Cassandra Heart
ee0947ec4b fix: on conflict criteria is ambiguous and cannot be used for upsert (#2197)
## Why is this change needed?

Shuttle defines the messages table with two unique constraints, one for
the hash, another for the triple of hash, fid and type. Postgres does
not allow multiple ON CONFLICT criteria, and ambiguous conflicts are
essentially surfaced as uniqueness violation failures in spite of ON
CONFLICT criteria given. This change alters the merge to instead attempt
insert, doing nothing on any conflict, then resolving with an update if
necessary and the original conflict resolution criteria is satisfied.

Addresses Issue #2167 

## 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 updates the conflict resolution logic in `MessageProcessor` to
fix ambiguity issues during upsert operations.

### Detailed summary
- Updated conflict resolution logic to use `doNothing()` method instead
of complex conditions
- Improved handling of conflict criteria for upsert operations

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

<!-- end pr-codex -->
2024-07-18 12:36:56 -05:00
Varun Srinivasan
e2b1c7c681 chore: upgrade libp2p to 0.44.0 (#2191)
## Why is this change needed?

Upgrades libp2p one minor version up ([Release
Notes](https://github.com/libp2p/js-libp2p/releases/tag/v0.44.0) |
[Migration
Guide](https://github.com/libp2p/js-libp2p/blob/main/doc/migrations/v0.43-v0.44.md))

### Breaking Change in Autodial + Connection Manager Behavior

libp2p's ConnectionManager now has a default minConnection threshold of
50. If the number of active connections is < this number, it will
attempt to redial peers that are in the store.

Since we only disconnect peers and do not remove them from our store,
the naive upgrade causes us to reconnect immediately to peers
unexpectedly. We now set the threshold explicitly to 0 to prevent this.
We should consider also removing peers from the peer store in a future
upgrade.


## 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 upgrades `libp2p` to version 0.44.0, updates
`@chainsafe/libp2p-gossipsub` to 6.2.0, and introduces
`@libp2p/interface-connection-gater` version 2.0.1.

### Detailed summary
- Upgraded `libp2p` to 0.44.0
- Updated `@chainsafe/libp2p-gossipsub` to 6.2.0
- Added `@libp2p/interface-connection-gater` version 2.0.1

> 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-18 02:42:53 +00:00
akira wu
c3ea869c18 fix(example): fix the argument for makeLinkRemove when removing a follow (#2196)
## Why is this change needed?

The change is a bug fix in the example code `write-data` in the
`hub-nodejs` package (packages/hub-nodejs/examples/write-data). When I
was trying to use this package, I was stuck with the original code for a
while and finally found it our by checking the source code. So I think
the change is needed because it can benefit others (especially new
developers) who want to build on Farcaster instead of getting stuck.

You can see here too that the test code for
`packages/core/src/builders.ts`
76ad1ac2a2/packages/core/src/builders.test.ts (L362)
is taking `'follow'` instead of `'unfollow'`

## 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)
- [ ] 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 correct the type of message being created
when removing a follow in the `write-data` example.

### Detailed summary
- Updated the type of message from "unfollow" to "follow" when removing
a follow in the `write-data` example.

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

<!-- end pr-codex -->
2024-07-17 17:22:57 -07:00
omar
db3b911715 chore: update github actions versions (#2190)
## Why is this change needed?

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

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


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update GitHub Actions and cache setup-node to
version 4 for better performance and reliability.

### Detailed summary
- Updated `actions/checkout` from v3 to v4 in
`.github/workflows/publish.yml`, `.github/workflows/release.yml`, and
`.github/workflows/release-packages.yml`
- Updated `actions/setup-node` from v3 to v4 in
`.github/workflows/release.yml` and
`.github/workflows/release-packages.yml`
- Updated `actions/cache` from v3 to v4 in
`.github/workflows/release.yml` and
`.github/workflows/release-packages.yml`

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

<!-- end pr-codex -->
2024-07-17 10:24:23 -07:00
Sanjay
76ad1ac2a2 feat: Expose event id functions (#2195)
## Why is this change needed?

Make timestamp to event id converstion function publicly accessible

## 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 new event ID functions and refactors timestamp handling in
the `core` and `hubble` packages.

### Detailed summary
- Added `extractEventTimestamp` and `makeEventId` functions in `core`
- Updated `console.ts` and `storeEventHandler.ts` to use the new
functions
- Refactored timestamp handling for event IDs

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

<!-- end pr-codex -->
2024-07-17 02:09:34 +00:00
Wasif Iqbal
97d0a7ea3a fix: update hub storage requirement to 200 GB (#2194)
## Why is this change needed?

- update hub storage requirement to 200 GB

## 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 storage requirement for the Hubble app to 200 GB and
adjusts related documentation to reflect the change.

### Detailed summary
- Updated Hubble app storage requirement to 200 GB
- Adjusted disk size in GCP tutorial to 200 GB
- Updated storage requirement in installation guide to 200 GB

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

<!-- end pr-codex -->
2024-07-16 15:47:23 -05:00
Wasif Iqbal
cf8c50c510 fix: force acknowledgement of no rewards for existing hubs (#2193)
## 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 running the script and updating the environment file accordingly.

### Detailed summary
- Added a function `prompt_for_hub_operator_agreement` to prompt for
agreement
- Created a function `update_env_file` to update or create the
environment file based on agreement
- Improved user input handling and validation
- Added logic to check for existing agreement in the environment file
- Updated the script flow to handle agreement properly

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

<!-- end pr-codex -->
2024-07-16 15:05:39 -05:00
Pavel Zaborskii
ee36f226d8 fix(docs): Improved GCP tutorial (#2175)
Fixes issue #2173 and some additional improvements
My Warpcast username: @pashu777

## Why is this change needed?

Users often encounter errors during the installation process due to
missing information in the documentation. This PR fixes several issues
in the Farcaster Hub installation guide for Google Cloud Platform (GCP).
The changes include adding missing steps, clarifying instructions, and
fixing grammatical errors to ensure a smooth setup experience for users.

### Change Summary

1. Enable Compute Engine API
   - Problem: After running the terraform apply command, users encounter
an error indicating that the Compute Engine API is disabled. This PR
includes a step to enable the API to prevent this error.
  
![GCP
Error](https://github.com/user-attachments/assets/28479156-fd80-4e90-929b-d606444cbadc)

- Solution: Added a step to enable the Compute Engine API before
proceeding with the installation. Included an illustrative screenshot
for guidance.

![gcp_compute_engine_api](https://github.com/user-attachments/assets/f393adcc-f74d-4a53-9fef-48f28e973e42)

2. GCP Configuration Clarity
   - Problem: When setting up the GCP virtual machine for the Farcaster
project, the configuration file ([main.tf](https://main.tf/)) includes
the placeholder $YOUR_PROJECT_ID. Users might mistakenly copy and paste
the configuration text without replacing $YOUR_PROJECT_ID with their
actual project ID, leading to errors.
   - Solution: Added text before the GCP virtual machine configuration
copy step to instruct users to replace $YOUR_PROJECT_ID with their
personal ID       

![gcp_project_id](https://github.com/user-attachments/assets/6afa67e1-4572-4da3-9e2a-f31b4edc6980)

3. Grammar Correction
   - Problem: Redundant text in the instructions: "Now follow the steps
as described on Install page page."
   - Solution: Removed the redundant word "page" for improved
readability.
![page page
](https://github.com/user-attachments/assets/782b1903-a031-4607-b40a-7261c552bcff)

## 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)
- [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
The focus of this PR is to update the main.tf file with instructions to
configure a GCP virtual machine and enable the Compute Engine API.

### Detailed summary
- Added configuration for GCP virtual machine with image references
- Instructed to replace "$YOUR_PROJECT_ID" with personal ID
- Provided steps to enable Compute Engine API
- Updated instructions for installing Docker
- Clarified steps to follow for setting up Hubble

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

<!-- end pr-codex -->
2024-07-15 17:42:06 -07:00
Wasif Iqbal
9ad23d5074 chore: release 1.13.7 (#2188)
## Why is this change needed?

- hub 1.13.7
- core 0.14.18
- hub-nodejs 0.11.20

## 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 increases version numbers for various packages and dependencies.
It also includes changes related to extending frame message URL max
length and assigning shards using a hashing algorithm.

### Detailed summary
- Increased version numbers for packages and dependencies
- Extended frame message URL max length
- Assigned shards using jump consistent hashing algorithm

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

<!-- end pr-codex -->
@farcaster/hubble@1.13.7 @farcaster/hub-nodejs@0.11.20 @farcaster/core@0.14.18
2024-07-15 16:14:43 -05:00
Shane da Silva
6bf952601f chore(shuttle): Release 0.5.6 (#2186)
## Why is this change needed?

Includes some performance improvements.

## 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` to `0.5.6` and
includes improvements related to stream trimming and recording size.

### Detailed summary
- Updated version to `0.5.6`
- Trim stream at regular interval
- Stop recording stream size
- Updated `@farcaster/hub-nodejs` to `0.11.20`

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

<!-- end pr-codex -->
@farcaster/shuttle@0.5.6
2024-07-15 19:39:48 +00:00
Shane da Silva
e5760da0d3 perf(shuttle): Trim stream at regular intervals instead of every iteration (#2185)
## Why is this change needed?

Performance profiling indicates that we're spending a non-trivial amount
of time (5-10% of wall clock time) trimming the stream. This doesn't
need to happen as frequently as it's currently happening, so switch to
an interval timer so that we're not slowing down general processing in
any meaningful way.

## 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 optimizes the event stream processing in
`HubEventStreamConsumer` by adding a regular interval to trim old events
efficiently.

### Detailed summary
- Added `interval` property to schedule event processing at regular
intervals
- Implemented interval logic to clear old events and process stale
events
- Updated `stop` method to clear the interval
- Simplified event processing logic in the message loop

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

<!-- end pr-codex -->
2024-07-15 19:28:13 +00:00
Wasif Iqbal
e0cb238cd0 Revert "fix: force acknowledgement of no rewards for existing hubs" (#2184)
Reverts farcasterxyz/hub-monorepo#2154

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to refactor the
`prompt_for_hub_operator_agreement` function in `hubble.sh` for better
user interaction.

### Detailed summary
- Refactored the `prompt_for_hub_operator_agreement` function for
improved user experience
- Removed unnecessary file operations and simplified the prompt logic
- Moved the prompt logic outside the function for better readability and
maintenance

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

<!-- end pr-codex -->
2024-07-15 14:09:08 -05:00
Shane da Silva
fc67ccf043 chore(shuttle): Stop recording stream size (#2183)
## Why is this change needed?

Looking at profiling data, this actually takes up a non-trivial amount
of wall clock time (10% of total time). Since the stream is
automatically trimmed, recording the size isn't particularly useful
except as perhaps an early warning on memory, but there are generally
other metrics one could use (number of events processed, etc.) to infer
that there is a slowdown in processing.

## 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 stops recording stream size in the `eventStream.ts` file of the
`@farcaster/shuttle` package.

### Detailed summary
- Removed recording stream size in eventStream.ts
- Removed statsd gauge and timing metrics for stream size and time
calculations

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

<!-- end pr-codex -->
2024-07-15 18:56:35 +00:00
Shane da Silva
63f29f1aca chore(shuttle): Release 0.5.5 (#2179)
## Why is this change needed?

To ensure this remains efficient at higher loads, perform before/after
hook processing in batches.

## 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` to `0.5.5`. It
includes efficiency improvements in before/after hooks and updates to
`@farcaster/hub-nodejs`.

### Detailed summary
- Updated version to `0.5.5`
- Efficiency improvements in before/after hooks
- Updated dependency `@farcaster/hub-nodejs` to `0.11.20`

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

<!-- end pr-codex -->
@farcaster/shuttle@0.5.5
2024-07-12 22:34:34 -07:00
Shane da Silva
27e3c7ae0c fix(shuttle): Switch before/after processing hooks to use batches (#2178)
## Why is this change needed?

This will be much more efficient at high loads.

## 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 optimizes event processing efficiency in `@farcaster/shuttle` by
switching before/after hooks to work with batches.

### Detailed summary
- Updated `PreProcessHandler` and `PostProcessHandler` signatures to
work with batches
- Refactored event processing logic to handle batches efficiently
- Improved event processing performance by processing events in batches

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

<!-- end pr-codex -->
2024-07-12 22:30:37 -07:00
Shane da Silva
b09009f508 chore: Release 0.5.4 (#2177)
## Why is this change needed?

We want to allow users to add pre-post processing logic when processing
hub events using Shuttle.

## 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 the `@farcaster/shuttle` package to
`0.5.4` and adds support for running before/after hooks when processing
events.

### Detailed summary
- Updated `@farcaster/shuttle` package version to `0.5.4`
- Added support for running before/after hooks when processing events

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

<!-- end pr-codex -->
@farcaster/shuttle@0.5.4
2024-07-13 04:01:34 +00:00
Shane da Silva
41f32cd0fa feat(shuttle): Support running before/after hooks when processing events (#2176)
## Why is this change needed?

We want the ability to provide custom pre/post-processing logic when
processing events. Expose optional hooks that can be specified. This has
the added benefit that the `beforeProcess` hook can be used to skip
processing of an event.

## 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)
- [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 enhances the `@farcaster/shuttle` package by adding support for
running before/after hooks when processing events.

### Detailed summary
- Added `beforeProcess` and `afterProcess` handlers to
`EventStreamHubSubscriber` and `HubEventStreamConsumer`
- Implemented handling of preprocess and postprocess actions for event
processing
- Introduced `EventStreamHubSubscriberOptions` and
`EventStreamConsumerOptions` interfaces
- Updated `HubEventStreamConsumer` to extend `TypedEmitter` for custom
event tracking

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

<!-- end pr-codex -->
2024-07-12 18:28:26 -07:00
horsefacts
fb0a083aef feat: increase frame message URL max length (#2174)
## Why is this change needed?

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

## 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 extends the maximum length of the frame message URL to 1024
characters for better validation accuracy.

### Detailed summary
- Increased maximum URL length validation from 256 to 1024 characters
- Updated test case with longer URL length for validation testing

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

<!-- end pr-codex -->
2024-07-12 18:26:42 -04:00
Shane da Silva
312340d210 feat: Assign shards using jump consistent hashing (#2171)
## Why is this change needed?

While modulo-based arithmetic for assigning shards is simple and works
fine, it does not work well when the number of shards changes.

For example, when increasing the number of shards from 3 → 4 using
modulo-based shard assignment, ~83% of FIDs will be assigned to a
different shard. With consistent hashing, only ~25% will be assigned to
a different shard.

Jump consistent hashing is a particular approach to consistent hashing
that is stateless (requires no additional tracking of shard
assignments), which is ideal for hubs, since we don't want hubs to have
to manage per-client tracking of shards.

## 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 focuses on implementing the jump consistent hashing algorithm
for shard assignment in the Hubble app.

### Detailed summary
- Implemented `jumpConsistentHash` algorithm for shard assignment based
on FID
- Updated shard assignment logic in `Server` class
- Updated tests in `eventService.test.ts` for shard-based event handling

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

<!-- end pr-codex -->
2024-07-12 12:24:41 -07:00
Varun Srinivasan
9e699617f7 Revert "chore: upgrade turborepo to v2" (#2170)
Turborepo 2 is causing sporadic failures when running lint:ci for
reasons that I don't quite understand. Since this isn't essential, I'm
reverting the change.

Reverts farcasterxyz/hub-monorepo#2156

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the `turbo` package version and refactors the
`turbo.json` configuration file structure.

### Detailed summary
- Updated `turbo` package version from `2.0.6` to `1.10.3`
- Refactored `turbo.json` configuration file structure
- Updated dependencies in `yarn.lock`

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

<!-- end pr-codex -->
2024-07-12 11:53:53 -07:00
Varun Srinivasan
3cf7a148c5 chore: upgrade rimraf to 6 (#2163)
## Why is this change needed?

Upgraded rimraf to the latest version. 

This requires Node 22 - while I tried to upgrade it in a previous PR I
forgot do to it for the build step of the Dockerfile, which is now fixed
here.

## 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 dependencies and versions in the project, focusing on
Jest, Rimraf, Minimatch, Minipass, Jackspeak, LRU-cache, and
Path-scurry.

### Detailed summary
- Updated Jest to version 29.6.1
- Updated Rimraf to version 6.0.1
- Updated Minimatch to version 10.0.1
- Updated Minipass to version 7.1.2
- Updated Jackspeak to version 4.0.1
- Updated LRU-cache to version 11.0.0
- Updated Path-scurry to version 2.0.0

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

<!-- end pr-codex -->
2024-07-12 11:06:18 -07:00
Shane da Silva
eeb1504e20 fix(shuttle): Fix broken build for 0.5.2 (#2169)
## Why is this change needed?

We didn't build the package correctly.

## 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 the version of the
`@farcaster/shuttle` package from 0.5.2 to 0.5.3.

### Detailed summary
- Updated package version to 0.5.3 in `package.json`
- Added entry for version 0.5.3 in `CHANGELOG.md`

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

<!-- end pr-codex -->
@farcaster/shuttle@0.5.3
2024-07-12 17:35:38 +00:00
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