Commit Graph

637 Commits

Author SHA1 Message Date
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 -->
2024-07-08 18:59:58 -07: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
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
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 -->
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 -->
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
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 -->
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
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
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 -->
2024-06-21 16:17:36 -07:00
Cassandra Heart
6ceb8f54bf fix: add patch to libp2p/peer-store to resolve broken peer id load failures (#2075) 2024-06-20 14:26:27 -05:00
Cassandra Heart
ad28172904 feat: support compact state type for links in message reconciliation (#2074)
## Motivation

Currently message reconciliation skips over LinkCompactState messages
when fetching from hubs, and depending on the logic of the caller of
that reconciler, it may make the caller mark the message as deleted (and
subsequently perform deletions on the follows).

## Change Summary

This change alters the hub message fetch to also call this RPC when
reconciling links. Important: users of this version will have to have
the corresponding RPC from #2068.

## 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 focuses on enhancing link reconciliation in the `shuttle`
package by calling the compact state RPC.

### Detailed summary
- Added a new method to retrieve link compact state messages by FID
- Updated imports in integration tests
- Implemented a test for reconciling messages and flagging incorrectly
deleted messages

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

<!-- end pr-codex -->
2024-06-20 13:52:27 -05:00
Sanjay
f25f133f30 chore: Segment bundle delay stats by message status (#2070)
## Motivation

Segment bundle delay stats by message status

## 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 segmenting bundle delay stats by message status in
the `handleGossipMessage` function of `Hubble`.

### Detailed summary
- Added tracking of bundle delay stats for invalid, success, and failure
cases
- Segmented bundle delay stats based on message status
- Improved reporting logic for gossip messages in `handleGossipMessage`

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

<!-- end pr-codex -->
2024-06-18 16:32:15 -07:00
Aditi Srinivasan
27a1cfc84a fix: log before exiting in hubble cli (#2062)
## Motivation

When running the `yarn identity create` I didn't know if my id was
created and where it was stored based on the output of the command. I
ran `node build/cli.js identity create` without the `--no-warnings` and
still didn't see any difference. Flushing before exiting the process
fixed the issue. I validated with the verify command

```
node build/cli.js identity verify .hub/12D3KooWCbYEURXXG3554vgSrBEWah4YxCebNghwWL5TvLSS7mmG_id.protobuf
{"hostname":"Aditis-MBP","pid":65745,"time":1718476986530,"level":30,"msg":"Flushing rust log buffer. Writing logs directly from Rust","flush_next":true}
{"level":30,"time":1718476986530,"pid":65745,"hostname":"Aditis-MBP","msg":"Successfully Read peerId: 12D3KooWEfACVRKnbdsEbPmsiJNAwwtq6pu7MtV4TFv54j2Te8cu from ./.hub/default_id.protobuf"}
```

## Change Summary

Flush logs before exiting a process in the hubble cli tool. 

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

<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to update the `cli.ts` file in the
`@farcaster/hubble` package to ensure logs are flushed before exiting.

### Detailed summary
- Updated `cli.ts` to use `flushAndExit` function for exiting with log
flush
- Replaced all `process.exit` calls with `return flushAndExit`
- Added `flushAndExit` function to flush logs before exiting

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

<!-- end pr-codex -->
2024-06-18 10:07:36 -07:00
Cassandra Heart
dab95118e0 feat: expose LinkCompactState messages via rpc (#2068)
## Motivation

Currently, our retrieval of Link messages only show adds/removes,
compact state messages serving as silent tombstones. This is fine for
getting a quick set of adds/removes as they currently apply, but may
produce confusing state when looking at two hubs, where one has the
message, and the other doesn't, and trying to reconcile why some
messages are missing from the one with the LinkCompactState message and
not the other.

## Change Summary

This change adds a new rpc GetLinkCompactStateMessageByFid, which
returns the relevant compact state message, if present.

## 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 standardizes the naming convention for `CastType` across
multiple files and adds support for `LinkCompactStateMessage` handling
in various store modules and RPC methods.

### Detailed summary
- Standardized `CastType` naming convention to `cast` in multiple files
- Added support for `LinkCompactStateMessage` in store modules and RPC
methods

> The following files were skipped due to too many changes:
`apps/hubble/www/docs/docs/api.md`,
`packages/hub-nodejs/src/generated/rpc.ts`,
`packages/hub-web/src/generated/rpc.ts`

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

<!-- end pr-codex -->
2024-06-17 20:46:28 -05:00
Shane da Silva
76c0504f7f chore: Lower level of shuttle logs to debug (#2063)
## Motivation

These logs aren't strictly useful in a normal sense.

## Change Summary

Lower them to debug log level to make the logs less noisy.

## 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
The focus of this PR is to lower the level of shuttle logs to debug in
the `MessageReconciliation` class in the `shuttle` package.

### Detailed summary
- Lowered the logging level to debug in `messageReconciliation.ts` for
better debugging.
- Replaced `this.log.info` with `this.log.debug` for certain log
messages.

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

<!-- end pr-codex -->
2024-06-15 22:53:16 -07:00
Sanjay
e58e963d0a fix: Always log when updating contact info (#2058)
## Motivation

We were only logging when we received a brand new contactInfo, we should
be logging everytime we see a new or updated contactInfo

## 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 `syncEngine` in the Hubble app to always log when
updating contact info.

### Detailed summary
- Updated `addContactInfoForPeerId` method to always log when updating
contact info
- Replaced `Err` with `Ok` in test for adding newer contact info
- Improved error handling for duplicate peer entries

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

<!-- end pr-codex -->
2024-06-14 13:22:17 -07:00
Sanjay
bca9618d98 chore: Release 1.13.1 (#2047)
## Motivation

Patch release with support for long casts

## 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)
- [x] 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 package versions in different modules, introducing
support for long casts and updating dependencies.

### Detailed summary
- Bumped version to `0.14.15` in `@farcaster/core`
- Added support for long casts
- Updated dependencies in various packages
- Incremented versions in `@farcaster/hub-web` and
`@farcaster/hub-nodejs`
- Increased version to `1.13.1` in `@farcaster/hubble`

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

<!-- end pr-codex -->
2024-06-13 18:23:46 +00:00
Sanjay
c424e111b2 feat: Implement longer casts FIP (#2045)
## Motivation

Implement https://github.com/farcasterxyz/protocol/discussions/182

## 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 adds support for long casts by introducing a new `CastType` enum
and updating validations and tests.

### Detailed summary
- Added `CastType` enum with `LONG_CAST`
- Updated validations for long casts
- Updated tests to support long casts

> The following files were skipped due to too many changes:
`packages/core/src/protobufs/generated/message.ts`

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

<!-- end pr-codex -->
2024-06-13 11:03:17 -07:00
Sanjay
deef9535f3 chore: Release 1.13 (#2043)
## Motivation

Release 1.13

## 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 versions and dependencies across multiple packages. 

### Detailed summary
- Extended verifications signature max length
- Updated dependencies in `hub-nodejs` and `shuttle`
- Changed `farcaster/core` version to `0.14.14`
- Released `hubble` version `1.13.0`
- Updated `FARCASTER_VERSION` to `2024.6.12`

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

<!-- end pr-codex -->
2024-06-12 12:21:19 -07:00
horsefacts
de52fbce0b feat: increase verification signature max length (#2038)
## Motivation

Coinbase Smart Wallet signatures are 1088 bytes long. We've bumped this
several times, so add some headroom on top.

## Change Summary

Increase verification signature max length to 2048 bytes.

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


<!-- start pr-codex -->

---

## PR-Codex overview
This PR extends the maximum length of the `claimSignature` field in
verifications to 2048 bytes for better validation accuracy.

### Detailed summary
- Increased `claimSignature` max length from 512 to 2048 bytes in
validations
- Updated test cases to reflect the new max length of `claimSignature`

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

<!-- end pr-codex -->
2024-06-11 12:16:55 -04:00
Shane da Silva
35d395f39c [chore] Add Node 22 to test matrix (#2033)
## Motivation

We eventually want to release hubs on Node 22, since it's been out for a
while.

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

<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the app version determination method, adjusts CI
configurations for ARM support, and refactors the app version retrieval
in `hubble.ts`.

### Detailed summary
- Updated app version determination method in `hubble.ts`
- Adjusted CI configurations for ARM support
- Refactored app version retrieval using manual JSON parsing

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

<!-- end pr-codex -->
2024-06-09 07:48:15 +00:00
Shane da Silva
877966972f [chore] Update TypeScript 5.0.2 to 5.4.5 (#2034)
## Motivation

Stay up to date.

## 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 updates the TypeScript version, exports multiple signatures for
`farcasterTimeToDate`, and includes a new dependency for `uint8-varint`.

### Detailed summary
- Updated TypeScript to version 5.4.5
- Exported multiple signatures for `farcasterTimeToDate`
- Added `uint8-varint` dependency

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

<!-- end pr-codex -->
2024-06-07 23:17:20 -07:00
Sanjay
1c2dde78f3 feat: Add HUB_OPTIONS env var to docker compose (#2032)
## Motivation

Allow customizing docker compose startup commands via a HUB_OPTIONS env
var

## 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 `docker-compose.yml` file for the
`@farcaster/hubble` app to allow customizing HUB_OPTIONS environment
variable.

### Detailed summary
- Added `HUB_OPTIONS` environment variable to docker compose for
`@farcaster/hubble` app
- Removed specific values for `HUB_OPERATOR_FID` and
`HUB_OPT_OUT_DIAGNOSTICS` in favor of `HUB_OPTIONS` customization

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

<!-- end pr-codex -->
2024-06-07 22:42:18 +00:00
Sanjay
32ba027b08 chore: Release hub-nodejs and core packages (#2030)
## Motivation

Publish version with the update builder

## 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
2024-06-06 18:46:55 +00:00
Cassandra Heart
911f8b23e6 chore: add builder for LinkCompactState (#2029)
## 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
- [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 adds a missing builder for `LinkCompactState` and refactors the
code to include the new builder function.

### Detailed summary
- Added `makeLinkCompactState` function to build
`LinkCompactStateMessage`
- Added `makeLinkCompactStateData` function for creating data for
`LinkCompactState`

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

<!-- end pr-codex -->
2024-06-06 13:28:45 -05:00
Sanjay
f36155a0cb chore: Release 1.12.3 (#2028)
## Motivation

Release 1.12.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


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates versions in various packages and dependencies, including
`@farcaster/hub-nodejs`, `@farcaster/shuttle`, `@farcaster/hubble`, and
`@farcaster/replicator`.

### Detailed summary
- Updated `@farcaster/hub-nodejs` to version 0.11.13
- Updated `@farcaster/shuttle` to version 0.3.0
- Updated `@farcaster/hubble` to version 1.12.3
- Updated `@farcaster/replicator` to version 0.3.8
- Added support for reverse reconciliation in `@farcaster/shuttle`
- Improved error message handling for bad host address in
`@farcaster/hub-nodejs`

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

<!-- end pr-codex -->
2024-06-05 15:56:59 -07:00
Sanjay
bb707b1efa feat(shuttle): add support for reverse reconciliation (#2026)
## Motivation

Fixes https://github.com/farcasterxyz/hub-monorepo/issues/2018

## Change Summary

Add support for reverse reconciliation where messages are present in the
db but missing in the 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.
- [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 adds support for reverse reconciliation in the
`@farcaster/shuttle` package.

### Detailed summary
- Added a new `onDbMessage` callback function to `MessageReconciliation`
class
- Implemented reconciliation of messages in the database but not in the
hub
- Added `DBMessage` type for database messages with relevant fields

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

<!-- end pr-codex -->
2024-06-04 22:30:39 -07:00
Shane da Silva
87c4f416e1 fix: Report better error message when hub address unspecified (#2024)
## Motivation

We want a better error message in this case, since the default is
unhelpful. Fixes #703.

## 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
The focus of this PR is to improve error handling by providing more
helpful error messages when an address is not specified in the
`hub-nodejs` package.

### Detailed summary
- Added better error message for unspecified address in `getSSLClient`,
`getInsecureClient`, and `getAdminClient` functions.

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

<!-- end pr-codex -->
2024-06-03 19:30:28 +00:00
Jean Prat
1c9f25275e fix(replicator): respect fnames_username_unique constraint (#1971)
## Motivation

When a fname is transfered, the fnames_username_unique prevents using
delete_at but requires a deletion of the data.

## Change Summary

Since hubble forgets about the old fname attachement, I choosed to
delete it instead of changing the constraint.
* fname <=> old fid is now deleted
* userproof <=> old fid is now deleted
 

## 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.
- [X] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

closes farcasterxyz/hub-monorepo#1970

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on respecting the `fnames_username_unique` constraint in
`usernameProof.ts`.

### Detailed summary
- Added patch to respect `fnames_username_unique` constraint
- Updated `processUserNameProofRemove` to delete from and insert into
`fnames` table based on conditions
- Changed `updateTable` to `deleteFrom` in `processUserNameProofRemove`
for `usernameProofs` table
- Updated conditions in `processUserNameProofRemove` to include `fid`
when deleting from `fnames` table

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

<!-- end pr-codex -->
2024-06-03 10:54:22 -07:00
Tobias Leinss
1bed6d18c6 fix(replicator): heap out of memory (#2022)
## Motivation

there's this ongoing issue of running out of memory with the apps.

e.g.  
https://github.com/farcasterxyz/hub-monorepo/issues/1015  
or  
https://github.com/farcasterxyz/hub-monorepo/issues/1407  

## Change Summary

Adding the node `--max-old-space-size` flag with the ram size fixes the
issue.

[The requirements speak of 2GB ram
requirement](https://github.com/farcasterxyz/hub-monorepo/blob/main/apps/replicator/README.md#requirements),
so setting this as default value.


a6367658e5/apps/replicator/docker-compose.yml (L11)

## 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.
- [X] All [commits have been
signed](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#22-signing-commits)

## Additional Context

-

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on fixing the replicator heap out of memory error by
setting a maximum old space size for the Node.js process.

### Detailed summary
- Updated `MAX_OLD_SPACE_SIZE` to 2048 in `.env.sample`
- Modified `command` in `docker-compose.yml` to include
`--max-old-space-size=${MAX_OLD_SPACE_SIZE:-2048}`
- Resolved replicator heap out of memory issue

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

<!-- end pr-codex -->

Signed-off-by: Tobias Leinss <caruso33@web.de>
2024-06-03 10:07:27 -07:00
Frederik Bolding
a6367658e5 fix: retry fname transfer fetch on fail (#2013)
## Motivation

Potential solution for
https://github.com/farcasterxyz/hub-monorepo/issues/2001. Adds a
mechanism to re-fetch fname transfers for a given name when merging a
`UserDataAdd` that fails due to missing proof.

## Change Summary

Refetches fname transfers when merging a `UserDataAdd` that errors out
due to a missing proof. Also moves some code around for testing
purposes.

## 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.
- [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 enhance the `@farcaster/hubble` module by
improving transfer retry logic and adding a new
`FNameRegistryClientInterface` with related functionalities.

### Detailed summary
- Added retry logic for fetching transfers on failed merge
- Introduced `FNameRegistryClientInterface` with methods for managing
transfers
- Updated `MockFnameRegistryClient` with transfer handling functionality

> The following files were skipped due to too many changes:
`apps/hubble/src/storage/engine/index.test.ts`

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

<!-- end pr-codex -->
2024-05-31 09:29:54 -07:00
Sanjay
33d4371504 perf: Remove by signer index (#2019)
## Motivation

https://github.com/farcasterxyz/hub-monorepo/pull/2012 with changes to
handle deleting existing data. Thank you @FrederikBolding.


This should save about ~15% of disk space.

## 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 removes the `BySigner` index to reduce disk usage and refactors
message handling logic for efficiency.

### Detailed summary
- Removed the `BySigner` index to reduce disk usage
- Refactored message handling logic for efficiency
- Updated message storage and retrieval functions

> The following files were skipped due to too many changes:
`apps/hubble/src/storage/engine/index.ts`,
`apps/hubble/src/storage/db/message.ts`

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

<!-- end pr-codex -->

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2024-05-28 17:23:13 -07:00
Frederik Bolding
053f3ac567 fix: remove unnecessary database reads when merging casts (#1996)
## Motivation

Since the base store implementation already handles conflicts for casts
correctly:
https://github.com/farcasterxyz/hub-monorepo/blob/main/apps/hubble/src/addon/src/store/store.rs#L195-L274
it feels wasteful to potentially use two additional DB lookups checking
for an identical edge-case.

This PR removes these two additional lookups and lets the base store
logic handle casts in the same way that all other stores are handled.

## Change Summary

- Remove two unnecessary database reads when merging casts

## 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 focuses on removing unnecessary database reads when merging
casts to improve efficiency and accuracy.

### Detailed summary
- Removed unnecessary database reads when merging casts
- Updated error message for conflicts with a more recent remove
- Refactored the `find_merge_add_conflicts` function to remove
unnecessary checks
- Updated test cases to reflect the new error message for conflicts

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

<!-- end pr-codex -->
2024-05-20 10:31:56 -07:00
Sanjay
9e1d8d2bc8 chore: Release 1.12.2 (#2007)
## Motivation

Release 1.12.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
This PR updates version numbers across multiple packages and adds a new
method `approxSize` to `getInfo()` in the core package.

### Detailed summary
- Updated versions to 0.14.12 in core package
- Updated versions to 0.11.12 in hub-nodejs package
- Updated versions to 0.8.9 in hub-web package
- Added `approxSize` method to `getInfo()` in core package
- Various dependency updates and fixes in different packages

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

<!-- end pr-codex -->
2024-05-16 17:13:24 -07:00
Sanjay
8c759d6652 fix: Throttle pruning so hub is not overloaded (#2005)
## Motivation

We're too aggressive during pruning which is causing hubs to become
unresponsive sometimes. Long term fix is to prune during merge, but that
involves migrating the storage cache to rust. Short term fix in the
meantime.

## 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 fixing the throttle pruning in `@farcaster/hubble` to
prevent hub overload.

### Detailed summary
- Updated `TIME_SCHEDULED_PER_FID_MS` to 5ms for temporary load
reduction on DB during pruning


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

<!-- end pr-codex -->
2024-05-16 15:30:10 -07:00
Sanjay
920f6c0251 fix: Fix grpcWeb import in hub-web (#2006)
## Motivation

We accidentally lost the code that was fixing up bad protoc js file
generation for hub-web. Bring it back and fix compilation.

## 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 `hub-web` package to fix the `grpcWeb` import and
replaces `grpc` with `grpcWeb` in the codebase.

### Detailed summary
- Updated `hub-web` package to fix `grpcWeb` import
- Replaced `grpc` with `grpcWeb` in the codebase for consistency

> The following files were skipped due to too many changes:
`packages/hub-web/src/generated/rpc.ts`

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

<!-- end pr-codex -->
2024-05-16 15:25:44 -07:00
Sanjay
8e7dec101a fix: Fix incorrect link message padding (#1994)
## Motivation

During the rust migration, link messages didn't have the full 0 padding
for add/remove keys. Fix that for future messages and add checks to
check for the incorrect padding and treat them the same as the correct
link messages everywhere.

Thank you @FrederikBolding for finding the bug in
https://github.com/farcasterxyz/hub-monorepo/pull/1983

## 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 fixes a padding bug in the link messages and refactors key
generation functions in the `LinkStore`.

### Detailed summary
- Fixed incorrect link message padding bug
- Refactored key generation functions in `LinkStore`
- Added padding with zero bytes for link type keys

> The following files were skipped due to too many changes:
`apps/hubble/src/addon/src/store/link_store.rs`

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

<!-- end pr-codex -->

---------

Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
2024-05-12 04:17:11 +00:00
Zach Terrell
c261fba667 [feat]: add approxSize to getInfo() endpoint (#1987)
## Motivation

Exposing the size of the rocks db 

## Change Summary

Updated `DbStats` to store `approxSize` of DB 

## 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.
- [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 new `approxSize` field to track database size in
various components and protobuf schemas.

### Detailed summary
- Added `approxSize` field to `DbStats` type
- Updated message structures to include `approxSize`
- Modified functions to handle `approxSize` calculations

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

<!-- end pr-codex -->
2024-05-07 16:25:39 -07:00