Commit Graph

88 Commits

Author SHA1 Message Date
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
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
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
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
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
adityapk00
5ca5a4a52d Create and gossip bundles (#1888)
## Motivation

Gossip MessageBundles instead of individual messages

## Change Summary

- The feature is in, but it is not turned on yet. It can be % rolled out
via network config

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

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces gossip MessageBundles, adds `mergeMany` method,
refactors message handling, and updates network configuration handling.

### Detailed summary
- Added gossip `MessageBundle` in `gossip.proto`
- Implemented `mergeMany` method in Rust functions
- Refactored message handling in various files
- Updated network configuration handling

> The following files were skipped due to too many changes:
`apps/hubble/src/network/p2p/bundleCreator.ts`,
`apps/hubble/src/storage/stores/rustStoreBase.ts`,
`apps/hubble/src/addon/src/store/store.rs`,
`apps/hubble/src/network/p2p/gossipNode.ts`,
`apps/hubble/src/storage/stores/castStore.test.ts`,
`apps/hubble/src/storage/engine/index.test.ts`,
`apps/hubble/src/test/e2e/hubbleNetwork.test.ts`,
`apps/hubble/src/network/p2p/bundleCreator.test.ts`,
`packages/hub-web/src/generated/gossip.ts`,
`packages/hub-nodejs/src/generated/gossip.ts`,
`packages/core/src/protobufs/generated/gossip.ts`,
`apps/hubble/src/storage/stores/castStoreBundle.test.ts`,
`apps/hubble/src/test/e2e/gossipNetworkBundle.test.ts`,
`apps/hubble/src/storage/engine/index.ts`,
`apps/hubble/src/network/p2p/gossipNodeWorker.ts`,
`apps/hubble/src/network/utils/networkConfig.test.ts`,
`apps/hubble/src/hubble.ts`

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

<!-- end pr-codex -->
2024-04-12 09:34:11 -05:00
adityapk00
d2b2f726d3 chore: Add rustfmt check for rust files before git commit (#1831)
## Motivation

Ensure consistent formatting of rust files. 

## Change Summary

Run `yarn lint:rust` to format all the rust files

## 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 adds a Rust code formatter check before Git commit, updates
linting scripts, and refactors code in the `LinkStore` module.

### Detailed summary
- Added Rustfmt check before Git commit
- Updated linting scripts in `package.json`
- Refactored code in the `LinkStore` module

> 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 -->
2024-03-20 10:21:48 -05:00
Shane da Silva
aacff0289b Remove eslint-config-custom dependencies (#1464)
These have been replaced by Biome.
2023-10-09 15:08:54 -07:00
Alex Grover
71e7120ec6 chore: replace rome with biome (#1351)
Co-authored-by: adityapk00 <31996805+adityapk00@users.noreply.github.com>
2023-09-07 08:43:02 -05:00
adityapk00
db354c59e6 fix: Pin Anvil version (#1301)
* ga test

* fix verbose

* Pin anvil version

* indent
2023-08-30 11:20:52 -05:00
Sanjay
bf1c44d2f1 feat: Add new signer event fields and new onchainevent RPC calls (#1276)
* feat: RPC compatibility for migration

* Add rpc tests

* Store key and metadata types on onchain signer events

* changeset

* Use generic iterator
2023-08-18 22:06:39 -07:00
Shane da Silva
1d07446152 fix: Display correct app version when run in Docker container (#1047)
Currently, if you call `getInfo` the version falls back to `1.0.0`,
which is confusing since users want to know which version of the hub
they are communicating with.

The reason this happens is because the `npm_package_version` environment
variable trick only works if you run via `npm`/`yarn`. Since we don't
want those as PID 1 (it interferes with signal processing) we build and
run directly with the `node` executable.

To get this to work, we create a symlink to `package.json` in the `src`
directory so that we can still reference the version specified in that
file.

This required some adjustments to have TypeScript not error (including
upgrading Jest), but should now work.
2023-07-10 16:47:06 -07:00
Varun Srinivasan
4c38067c15 chore: switch from eslint/prettier to rome (#1074)
* chore: add rome config files

* chore: add rome into configs and ci

* chore: remove eslint annotations

* chore: update annotations for rome ignores

* chore: remove prettier
2023-07-04 19:09:15 -07:00
Varun Srinivasan
5dba132d64 chore: update dev deps (swc, rimraf, lint-staged, turbo) (#1024) 2023-06-18 11:19:35 +01:00
Sanjay
37f515f049 feat: Add app version to contact info and log it when syncing (#990)
* feat: Add app version to contact info and log it when syncing

* Add changeset
2023-05-23 17:32:47 -07:00
Shane da Silva
967fb3922c Build and test on Node.js 20 (#972)
This version includes updates to the V8 runtime and performance
improvements.

While here, update our test suite to test on both Node 18 and 20.
2023-05-16 14:30:52 -07:00
Paul Fletcher-Hill
59ea2f9d42 add release-all script (#871) 2023-04-13 00:10:07 -04:00
Paul Fletcher-Hill
39387aa702 add release-packages workflow (#862) 2023-04-11 22:28:54 -04:00
Paul Fletcher-Hill
1c6838ac7b upgrade turbo and add protoc command (#853) 2023-04-10 18:56:04 -04:00
Vincent Liao
f875c1ed65 chore: turn prettier into its own package (#653)
* chore: separate out prettier from eslint into its own package

* fix: duplicate package name in package.json
2023-03-19 12:47:15 -07:00
Varun Srinivasan
2e0d95f33a chore: upgrade minor and patch versions of monorepo dependencies (#659) 2023-03-16 13:18:35 -07:00
Varun Srinivasan
3a1ead3039 chore: upgrade typescript to v5 from v5beta (#656) 2023-03-16 10:48:06 -07:00
Varun Srinivasan
7588fffdd5 docs: remove typedoc and outdated docs (#639) 2023-03-13 05:19:11 -07:00
Vincent Liao
7af59f9fd4 docs: @farcaster/js (#590)
* fix: relative path on hubble docs not resolving to contributing.md

* add: initial table structure of the docs

* remove: link on first column

* add: docs/Ed25519Signer.md

* fix: wrong links in Ed25519Signer.md

* fix: wrong link again

* add: constructor to ed25519signer.md

* add docs/Eip712Signer.md

* update: replace ambiguous description with TODO

* update: code example on readme

* add: a comment about neverthrow

* add: js docs to interact with hub

* update: wrong import on docs

* remove: make Data and Amp functions

* update: clarify the eddsa private key part

* update: move signer docs to readme

* update: readme table

* fix: wrong path

* add: docs for eip signer but in js

* remove: ambiguous descriptions

* add: doc generation with TypeDoc

* add: docs for ed25519 signer

* update: build first before running docs

* update: only use packages/js for typedoc entrypoint

* remove: function name in tsdoc comments

* update: move examples up for clarity

* add: typedoc.json

* add: description for properties of signers

* update: link to classes in readme

* update: move make message explanation above

* remove: ambiguous description in readme

* add: a line in contributing.md about generating docs for packages/*

* remove: old docs

* update: recompiled docs and add plugin on typedoc.json

* add: description to sign verification

Co-authored-by: Anthony D'Addeo <tony@tavour.com>

* update: use yarn instead of npm

Co-authored-by: Anthony D'Addeo <tony@tavour.com>

* update: disable typedoc source

* update: contributing.md packages/* to packages/js

* update: TODO to TODO DOCS

* fix: eip712 signer not rendering properly

* add: docs to message builders

* add: docs to client

---------

Co-authored-by: Anthony D'Addeo <tony@tavour.com>
2023-02-23 21:15:07 -08:00
Paul Fletcher-Hill
0c32de2230 chore: bump changeset versions (#594)
* bump package versions

* add prepublishOnly scripts to packages

* fix changelog typo

* remove lint from prepublishOnly
2023-02-19 13:57:44 -05:00
Varun Srinivasan
d6634cfdd3 chore: upgrade to typescript v5 beta (#527) 2023-02-04 10:45:10 -08:00
Varun Srinivasan
afd5a2946a chore: upgrade packages [feb 2023] (#514)
* chore: upgrade tsx, typescript

* chore: upgrade jest minor version

* chore: upgrade @swc minor

* chore: upgrade eslint, prettier minor

* chore: upgrade minor packages husky tsx

* chore: upgrade minor package undici

* chore: upgrade noble/hashes minor

* chore: upgrade ts-proto minor

* chore: upgrade grpc-js patch

* chore: upgrade rimraf major

* chore: upgrade turbo again

* chore: update node-cron types patch, move to dev deps
2023-02-03 12:22:22 -08:00
Shane da Silva
0ea683980e fix: Pin Turbo to 1.7.0 to fix Docker builds (#506)
Our previous attempts to fix the build in 50cfacd5 and 1c932091 didn't
work because we had a locally cached layer which lead to an older
version of Turbo being used, which didn't suffer from this bug.

The workaround (for now) is to pin to 1.7.0 explicitly when installing
`turbo` in the Docker build step (which previously wasn't using the
version listed in `package.json`).
2023-02-02 14:49:09 -08:00
Shane da Silva
1c93209182 fix: Update Turbo 1.6.3 → 1.7.3.canary.1 to fix Docker builds (#505)
We need this update to fix an issue with our builds that occurs on
GitHub Actions only (cannot repro locally).

Based on [this
issue](https://github.com/vercel/turbo/issues/3570#issuecomment-1413350084),
this should be fixed in 1.7.3, but since that release is not available,
we'll use the canary for now.
2023-02-02 13:51:45 -08:00
Shane da Silva
50cfacd5ac Fix Docker image builds post Hub→Hubble rename (#503) 2023-02-02 13:17:09 -08:00
Paul Fletcher-Hill
58738a4409 nuke flatbuffers code (#479) 2023-01-30 14:45:08 -05:00
Paul Fletcher-Hill
3b68731981 chore: introduce changesets for package versioning and publishing (#433)
* changeset initial commit

* update root package.json

* use changelog-git package for changesets
2023-01-17 00:11:56 -05:00
Anthony D'Addeo
6555674168 chore: add clean to turbo pipeline (#405)
* chore: add clean to turbo pipeline

* add clean script to root package
2023-01-11 09:39:35 -05:00
Paul Fletcher-Hill
d3583ba7d5 chore: rename packages and move app to apps/hub (#399)
* add js package readme

* change name to @farcaster/js

* intermediate commit

* update package names and build scripts

* delete renamed files

* revert eslint package upgrades and remove changelog

* move root dependencies to devDependencies

* v0.1.1

* v0.1.1

* v0.1.1

* v0.1.2

* build with tsup

* regenerate yarn.lock

* remove unused package-lock.json file

* reset yarn.lock
2023-01-09 22:51:54 -05:00
Paul Fletcher-Hill
b641f59a42 refactor: move bytes and errors to packages (#381)
* refactor: move bytes and errors to packages

* remove shard strategy

* try fixing ci again
2023-01-04 12:54:44 -05:00
adityapk00
c5d9cc2e49 feat: RPC to get Trie snapshots/hashes (#373)
Fixes #363
2023-01-03 09:04:19 -08:00
Varun Srinivasan
a198dda18e refactor: monorepo (#340)
* feat: configure turborepo to run tasks

* refactor: set up app/ workspace

* fix: move tsconfig up and inherit

* fix: update turborepo

* refactor: extract flatbuffers to package

* fix: ci by using symlink instead of yalc

* refactor: extract eslint config

* ci: add manypkg to catch package issues

* security: remove manypkg due to yarn audit fail

* fix: misc changes

* refactor: move config into hub

* fix: export as module

* remove: manypkg postinstall
2022-12-31 17:12:50 -08:00
Paul Fletcher-Hill
6b9be8084d feat: add RevokeSignerJob class and queue signer revocation from hub (#331)
* feat: add RevokeSignerJob class and queue signer revocation from hub

* remove commented out line in test

* split job queue and scheduler into separate classes

* revert ethEventsProvider little endian change

* cleanup revokeSignerJob test

* ignore generated flatbuffer files with jest
2022-12-29 09:52:03 -05:00
adityapk00
4fef556861 fix: flatc generation (#333) 2022-12-28 10:11:13 -08:00
Anthony D'Addeo
5d99da1dc4 perf: use swc to transform TS in jest (#330)
Speed up est execution
2022-12-27 14:47:21 -08:00
leonard
4f1cdb07dc refactor: automatically reorder imports using prettier-plugin-organize-imports (#316)
* feat: add prettier-plugin-organize-imports

* refactor: reorder imports
2022-12-21 12:32:57 -08:00
Varun Srinivasan
f7319d7f3f chore: upgrade packages (dec 16, 2022) (#293)
* upgrade: typescript to 4.9

* upgrade: minor versions for tsx, prettier, jest, lint-staged, eslint, pino

* upgrade: minor versions for flatbuffers, undici

* upgrade: patch versions for husky, node and jest types

* upgrade: major version of neverthrow

* upgrade: grpc minor version
2022-12-16 23:00:06 -08:00
adityapk00
5e072a55e1 Add flatc generation (#267)
- Add `yarn flatc` to regenereate all flatbuffers
- Update instructions in Contributing.md
2022-12-06 15:06:30 -05:00
Paul Fletcher-Hill
869a2bd670 feat: upgrade flatbuffers to latest version (#263)
* feat: upgrade to latest flatbuffers version

* undo unused jest.config change
2022-12-05 14:05:18 -05:00
Paul Fletcher-Hill
b67d22f5d6 feat: casts gRPC implementation (#219)
* feat: initial grpc commit

* refactor RPC cast service into own file

* add failure test to rpc castservice

* remove out-of-date test suite

* resolve merge conflicts

* refactor rpc, engine, validation to results and hubErrors

* fix: lint warnings

* fix server.ts for new hub error codes

* use HubError now that stores throw them

* improve engine test coverage
2022-11-11 20:02:33 -05:00
Sagar
bcd6ab18d5 feat(p2p): advertise public IP over gossip (#220)
* feat(p2p): advertise public IP over gossip

* fix: only use local IP addrs in tests

* fix: explicitly use advertised public IPs for RPC
2022-11-09 18:17:08 -05:00
Sagar
2c8798e863 chore: add progress logs to perf tests (#192) 2022-10-31 16:38:09 -07:00
Sanjay
61fc294cfe feat: Implement diff sync (#179)
* feat: trie snapshots

* feat: implement differential sync for messages

* Handle reaction race condition and syncing id registry events

* cleanup and add more tests

* fix: add more tests around syncing and fix uncovered bugs

* Address review comments. Minor cleanup.

* move TrieNode to own file and additional cleanup/review comments
2022-10-30 09:07:23 -07:00
Varun Srinivasan
ac323e9e02 chore: replace faker with faker-js (#186) 2022-10-28 15:43:21 -07:00