Commit Graph

379 Commits

Author SHA1 Message Date
adityapk00
6e7ce940ab perf: Don't await leaf nodes during sync (#1097)
* perf: Fetch upto 4 leaf nodes at a time

* changeset
2023-07-11 10:16:50 -05:00
adityapk00
850f82f278 perf: Add a Sync Profiler (#1098)
* feat: Add Sync profiler

* changeset

* bugfix

* pretty print

* cleanup
2023-07-11 10:16:35 -05:00
Shane da Silva
f9ebc7c93f Fix allowed peer IDs behavior (#1103)
This was broken by d5d65bdc.
2023-07-10 23:52:49 -07:00
Sanjay
cd0ddd6d24 feat: Support ENS names in the hub (#1101)
* feat: Add ENS username proof support

* Add UserNameProof store

* ENS name ownership validations

* Add remaining ens validations

* Generate events correctly

* Allow setting ens names on UserData and handle revoking it

* Add changeset and cli flag
2023-07-10 23:40:50 -07:00
Shane da Silva
d5d65bdc62 Prevent connecting to peers not in allowed peer list (#1102)
We needed to add some additional logic to ensure we didn't connect to
peers not in the allowlist.
2023-07-10 22:13:37 -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
dependabot[bot]
847046ff93 build(deps): bump @grpc/grpc-js from 1.8.7 to 1.8.8 (#1083)
Bumps [@grpc/grpc-js](https://github.com/grpc/grpc-node) from 1.8.7 to 1.8.8.
- [Release notes](https://github.com/grpc/grpc-node/releases)
- [Commits](https://github.com/grpc/grpc-node/compare/@grpc/grpc-js@1.8.7...@grpc/grpc-js@1.8.8)

---
updated-dependencies:
- dependency-name: "@grpc/grpc-js"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 14:31:50 -07:00
Shane da Silva
084b72f353 chore: Remove one more old hub (#1100) 2023-07-10 13:20:42 -07:00
Shane da Silva
c157a5f97a chore: Remove hubs from allowed peers list running old versions (#1099)
Due to a bug in the sync logic in older versions, these hubs can spam
messages that are pruned, which consumes bandwidth and results in the
`submitMessage` API call taking longer than it should.

For now, remove these peers. They can add themselves back once they have
upgraded.
2023-07-10 11:31:50 -07:00
Akshaan Kakar
2bfcaf4ec3 feat: create a system to track network propagation delay (#970)
* Add new proto definitions

* Add ping and ack functions

* Add gossip event handler

* Add cli argument for network latency mode

* Add ping message scheduler

* Fix imports

* Add tests for message handler

* Add metrics store

* Fix cli arg name

* Add multinode setup and fix metric logging

* Add docker-compose file for multinode test setup

* Drop hard coded id paths

* preserve backward compatibility of process file path

* Enable gossip network diagnostics

* Add tests 1

* Clean up gossipNode tests

* Fix lint

* Lower frequency for latency pings

* Add tests for metrics

* Improve coverage computation algo

* Clean up

* Fixes from PR feedback

* Fixes from PR feedback

* Fixes from PR feedback

* Rename field for consistency

* Add jitter to ping cron

Add jitter to ping cron

* Log legible peerIds

* Fix import paths

* Update log field name

* Consolidate metrics recorder and ping job

* Fix docker compose

* Add time-to-merge metric

* Confine metrics logic to single class

* Clean up

* Fix div by zero

* Use peerId string as metrics key

* Drop unused getter

* Refactor metrics to be keyed by peerId

* Fix tests

* Clean up and fix tests

* Store metrics in DB

* Replace interfaces with types

* Fix testS

* WIP: Adding metrics serde

* Replace map with object to allow for metrics serde

* Add test for serde

* Fix security warnings

* Fix coverage logging

* Add test

* Move message handling to hub

* Fix timestamp overflow

* Lower ping freq and fix coverage logging

* Add peer network to logs

* Fix merge time metric

* Revert "Fix merge time metric"

This reverts commit 76beb5f11a.

* Expire metrics after logging

* Rename command line arguments

* Fixes + test updateS

* Fixes + test updateS

* Add test for expiry

* Add test for ping function

* Drop unused function

* Record merge times for all merges

* Don't accumulate message count metrics

* Add check for successful message merge

* Re-add generated code

* Fix types

* Re-add generated code

* Fix imports

* fix imports
2023-07-07 21:02:59 -04:00
Shane da Silva
dbe6074812 feat: Allow log level to be configured via environment variable (#1089)
This is useful in allowing operators to quiet logs if they so choose.
2023-07-07 20:00:50 +03:00
Shane da Silva
f9c978a289 Include bad_request.prunable in list of INVALID_ARGUMENT errors (#1088) 2023-07-07 19:56:52 +03:00
adityapk00
1d1e84468d fix: Add overheads to storage profile (#1087)
* fix: Add overheads to storage profile

* cleanup
2023-07-07 10:23:08 -05:00
Tony D'Addeo
f54185f30a chore: hard fail if cannot connect to eth RPC provider (#1086)
* chore: hard fail if cannot connect to eth RPC provider

* add changeset
2023-07-06 17:24:52 -05:00
adityapk00
229b806dd3 Add rocksDB storage profiling (#1085)
* feat: Profile rocksDB storage

* changeset

* fix

* fix index calculation

* cleanup
2023-07-06 13:42:56 -05:00
woj.eth
c035594406 Add @woj peer id (#1084) 2023-07-06 10:51:24 -05:00
road
e7a24088de Update allowedPeers.mainnet.ts (#1082) 2023-07-06 10:51:15 -05: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
f176841daf chore: prepare for rome migration (#1077) 2023-07-04 17:48:54 -07:00
Varun Srinivasan
9ffbcc3a99 chore: prepare for rome-tools migration by formatting files (#1073)
* chore(@farcaster/core): apply rome formatter

* chore(@farcaster/hub-nodejs): apply rome formatter

* chore(@farcaster/hub-web): apply rome formatter

* chore(@farcaster/hubble): apply rome formatter
2023-07-04 14:30:23 -07:00
Varun Srinivasan
fe7aeb99c3 chore: update peer ids (#1072) 2023-07-04 11:56:20 -07:00
adityapk00
a08bff38ac fix: Better error if hub config is misspecified (#1067)
* fix: Better error if hub config is misspecified

* changeset
2023-07-03 11:13:48 -07:00
Varun Srinivasan
430736a0b4 chore: add peerids for razzle, pseudobun (#1068) 2023-07-03 11:11:07 -07:00
adityapk00
fcf8138616 fix: Update adityapk00 key (#1066) 2023-07-03 10:50:27 -05:00
Sanjay
abb7df9cdd chore: Release 1.3.3 (#1065) 2023-07-02 21:52:27 -07:00
Michael Boyle
bd8160cf37 Update allowedPeers.mainnet.ts (#1063)
Added @mboyle's hub to list
2023-07-02 17:36:50 -05:00
Tony D'Addeo
abca3ed362 fix: prune limits on store subclasses (#1064)
* fix: prune limits on store subclasses

Overriding class fields in Javascript is tricky as they are not
available in the parent constructor.

Refactored into getters since these will be available.

* add changeset

* fix test
2023-07-02 15:38:25 -05:00
Cameron Armstrong
fa6f7aa84f Update allowedPeers.mainnet.ts (#1056) 2023-06-30 15:31:08 -07:00
Cassandra Heart
1ca8fdcba5 Revert "feat: storage registry support (#1030)" (#1051)
This reverts commit a9da418dbc.
2023-06-29 17:20:36 -05:00
Cassandra Heart
a9da418dbc feat: storage registry support (#1030)
* Initial commit of L2 provider/storage contract integration

* l2 storage admin

* storage store

* update mockhub

* viem

* adjust import

* adjust import

* weave in config

* flesh out l2 test

* storage registry test

* strawman the storage tests

* null check

* switch type

* further updates, updated abi

* temporarily disabling test until anvil issue is sorted out

* more tests

* weird slowdown in node18 test on ci

* ok

* confirm iterator ordering

* rework timestamp into event message

* more coverage
2023-06-29 16:53:22 -05:00
Federico Castelli
3c78b9e0a9 Update allowedPeers.mainnet.ts (#1050)
Add my custom peerId to be allowed to use Farcaster Hub on Mainnet
2023-06-29 09:31:06 -05:00
Sanjay
5a1baaedbb feat: Switch from name events to username proofs (#1049)
* feat: switch to username proofs

* Add rpc endpoint

* Add changeset
2023-06-28 17:36:11 -07:00
Tony D'Addeo
9e03df8579 chore: publish package version (#1048) 2023-06-28 15:42:59 -05:00
Tony D'Addeo
bfdbfea6b0 chore: use viem in @farcaster/core (#1037)
* chore: use viem instead of ethers

* add changeset

* remove more ethers usages

* move ethers to dev dependecy

* add signUserNameProof to Eip712Signer

* expand test coverage

* update changeset

* add makeUserNameProofClaim

* prefer @noble/hashes/utils in examples
2023-06-26 11:27:13 -05:00
dependabot[bot]
243e4fcf2c build(deps): bump semver from 7.5.0 to 7.5.2 (#1032)
Bumps [semver](https://github.com/npm/node-semver) from 7.5.0 to 7.5.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.5.0...v7.5.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-23 10:12:38 +01:00
Igor_R
372e9bd09f Update allowedPeers.mainnet.ts (#1028) 2023-06-23 10:12:03 +01:00
Shay Zluf
db3be8b795 Update allowedPeers.mainnet.ts add Hats.finance node (#1023)
* Update allowedPeers.mainnet.ts

add hats.finance node

* farcaster user
2023-06-23 10:11:09 +01:00
Tony D'Addeo
159c62df7a chore(hubble): use viem to interact with ethereum (#997)
* chore: use viem to interact with ethereum

* add ViemLocalEip712Signer to exports

* add codecov exceptions

* upgrade viem

* add log for historically synced blocks

* fix test

* poll every 4 seconds

* clean up pre-viem 1.0 code

* update viem

* update comments
2023-06-22 14:50:18 -05:00
Sanjay
f1c15510d1 chore: release 1.3.1 (#1031) 2023-06-21 19:47:51 -07:00
Sanjay
f1c6b25c23 feat: Support fname registry server and store user name proofs (#1014)
* feat: Initial fname registry provider class

* flesh out fname registry provider functionality

* Update to match fip

* Use new query params and gradefully handle errors

* feat: add support for verifying username proofs

* Validate server signatures before submitting username proofs

* Add changeset and default fname server url
2023-06-21 19:33:01 -07:00
hellno
9d08463ff6 remove .DS_Store files (#1029) 2023-06-21 12:22:51 -07:00
Brandon H. Gomes
6e8f598902 chore: add bhgomes peer id (#1019)
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
2023-06-21 10:51:47 +01:00
Rysiman
3317d8ae01 Update allowedPeers.mainnet.ts (#1025)
add @rysiman peer id
2023-06-20 15:50:05 +01:00
silentnoname
ea2db9311d add peerid @silent (#1026) 2023-06-20 14:08:17 +01:00
Sheldon Trotman
1bdabda952 Adding sheldons hub peerid (#1020)
Signed-off-by: Sheldon Trotman <sheldot@users.noreply.github.com>
2023-06-18 10:54:38 +01:00
Akshaan Kakar
7d7d256b37 fix: Close open db iterators from job queues (#1021)
* Close open db iterators from job queues

* Fix log line
2023-06-15 16:44:23 -04:00
Akshaan Kakar
e107a1c976 bug(hubble): db size grows too fast during sync (#1011)
* Add test command

* Call iterator.end when using .next traversal

* Simulate deletions

* Revert local test changes

* Revert whitespace changes

* Fix hanging iterator in getPageIteratorByPrefix

* Add system to track open RocksDB iterators

* Clean up test

* Add iterator options to logs

* Simplify log

* Close iterator in castStore
2023-06-15 14:36:31 -04:00
Ken Goldfarb
fa7ce31b81 chore: add peerid @kencodes (#1010) 2023-06-14 07:41:45 +01:00
Cassandra Heart
7dabc0b006 chore(hubble): General Store (#1001)
* initial draft of general store

* pr feedback, mass simplification, next up, the swap-out

* incorporate txn to SIdxs

* cast store converted

* convert links store

* convert reaction to general store

* convert all stores, resolve warnings around null checks with appropriate action per situation

* add changeset
2023-06-13 16:01:00 -05:00
Sanjay
6667748a67 fix: Handle peers with zero messages when printing status (#1008)
* fix: Handle peers with zero messages when printing status

* Add changeset
2023-06-05 15:10:17 -07:00