Commit Graph

166 Commits

Author SHA1 Message Date
Sanjay
e072a0e535 chore: Release 1.3.4 (#1109) 2023-07-11 17:34:17 -07:00
Sanjay
4fa7a56153 Rename UserDataType.FNAME to USERNAME (#1108) 2023-07-11 17:16:53 -07:00
adityapk00
e513a3f326 [WIP] perf: Prevent un-necessary network calls when syncing (#1096)
* fix: Strip out any syncIDs we already have

* changeset

* optimization

* test
2023-07-11 12:23:08 -05:00
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
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
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
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
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
Sanjay
abb7df9cdd chore: Release 1.3.3 (#1065) 2023-07-02 21:52:27 -07: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
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
d8729a7734 chore(hub-web): remove @improbable-eng/grpc-node-http-transport (#1043) 2023-06-26 12:50:51 -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
Tony D'Addeo
27fd99ff16 chore: update changesets (#1033) 2023-06-22 14:56:18 -05: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
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
Sanjay
c6fc422193 fix: server no longer hangs due to slow subscribers (#1004)
* fix: server no longer hangs due to slow subscribers

* Preserve ordering and allow more grace period for slower clients to catch up
2023-06-01 17:37:48 -07:00
Sanjay
9654197697 chore: Release 1.3 (#1000)
* chore: Release 1.3

* bump version
2023-05-31 10:02:16 -07:00
Tony D'Addeo
27181c6ced feat: add fallback to dbreset (#996) 2023-05-26 15:12:52 -05:00
Cassandra Heart
2bc598abcc feat: Links (#973)
* rolling up changes for links FIP

* typeToSetPostfix

* pr feedback

* consistency to avoid js quirks

* add versioning logic and update tests

* include version check in mergeMessages

* update protobuf comment to reflect nit

* added changeset

* code coverage
2023-05-24 19:42:26 -05: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
Sanjay
16ea9b4a2b fix: validate the network in ethEventsProvider (#982)
* fix: validate the network in ethEventsProvider

* changeset
2023-05-18 17:58:58 -07:00
Shane da Silva
7f050d23fe fix: Correctly error when sequence ID exceeds max allowed value (#971)
We had this implemented incorrectly. We need to error once it meets or
exceeds the limit, since you can only store (2^N - 1) for a binary value
with N bits.
2023-05-16 13:10:06 -07:00
Shane da Silva
a4cb2c4b75 chore: Release 1.2.3 (#968) 2023-05-15 15:01:33 -07:00
Cassandra Heart
434444718c fix(eth): add stronger retry logic to eth events provider (#959)
* fix(eth): add stronger retry logic to eth events provider

* test has sporadic failure on CI, appears to be due to unresolved promise, perhaps this will fix

* alter retry provider to throw on retry limit

* more slight adjustments, makes concurrent tests stop freaking out

* add http status code to enforce retry

* slight changes to increase code coverage

* avoid clobbering globals

* await on emit

* finally hunted down RC, it's a timer, deep in subscriber

* ignoring mock utils

* exponential backoff + faster tests
2023-05-15 14:12:16 -07:00
Shane da Silva
ea55abcb83 Add separate Dockerfile for dedicated public image (#962)
We want to make it easier for developers to get started with hubs.

Add a separate optimized Docker image which we'll distribute for both
AMD and ARM architectures.

For now the publishing process is manual, but once hubs are fully open
(no peering allowlists) we'll be able to auto-publish with each hubble
release on NPM.
2023-05-11 20:31:45 -07:00
Shane da Silva
651df4120f Remove unnecessary @faker-js/faker dependency from core (#961)
This dependency is only required for dev, not production. It's used by
Hubble when generating fake data, however, so move it to a production
dependency for Hubble.
2023-05-11 15:52:05 -07:00
Shane da Silva
fe755fbdb3 Switch to rocksdb fork with precompiled Linux ARM build (#960)
With more Macs running ARM via Apple Silicon, the significantly slow
package installation was problematic. Fix by using our fork which
includes the prebuilt binary to reduce install time.
2023-05-11 10:04:49 -07:00
Anthony D'Addeo
2ca66b179c chore: upgrade to @noble/curves (#947)
* chore: update @farcaster/core to use @noble/curves

* chore: update hubble to use @noble/curves

* add changeset

	new file:   .changeset/eleven-lies-wait.md

* preserve async interface

* update changeset
2023-05-10 12:26:07 -05:00
Sanjay
c489175437 feat: Sync status improvements (#954)
* feat: improve status reporting

* Add changeset

* Fix test
2023-05-10 10:02:26 -07:00
Sanjay
f7a62a52f1 chore: Release 1.2.2 (#949) 2023-05-08 17:28:13 -07:00
Sanjay
1236b4e956 feat: Add a status hubble command for friendly reporting of current hub status (#944)
* feat: Suport sync status rpc call

* Add sync status hubble command

* Fix generated file

* Changeset

* Fix isSyncing check

* Rename to status and report db stats as well

* Fix error
2023-05-08 14:48:24 -07:00
Sagar Dhawan
530878831d fix: improve handling of duplicate messages on gossip (#919)
* fix: improve handling of duplicate messages on gossip

* fix tests

* fix changeset

* make gossip backwards compatible

* fix tests
2023-05-05 13:02:52 -07:00
Paul Fletcher-Hill
2e633db09b feat: reject prunable messages on merge (#928)
* feat: don't merge messages that would immediately be pruned

* Fix tests and minor cleanup/review comments

* Support all other stores

* Add changeset

* use prune iterator with keys available and expand cast store tests

* re-add prune iterator args

* Additional tests

* Add tests for other stores

---------

Co-authored-by: Sanjay Raveendran <sanjayprabhu@gmail.com>
2023-05-04 10:35:32 -07:00
Paul Fletcher-Hill
d2cb5e4e30 fix: validate parentUrl and targetUrl comprehensively (#935) 2023-05-03 21:04:05 -04:00
Sanjay
52fc714970 chore: Release 1.2.1 (#925) 2023-04-27 14:36:13 -07:00
Michael Huang
6a8486017e feat: implement ViemLocalEip712Signer (#787)
* Implement viemEip712Signer

* Add tests

* clean

* Stubs

* Deps

* Fixes

* Clean

* Fix bugs

* Rename

* Add changeset

* rename

* clean up

* rename

* update import

* Upgrade

* Update test

* ViemEip712Signer -> ViemLocalEip712Signer

* clean up

* Convert hash bytes to hex string before signing

* use random wallet

* Add test for mnemonic account

* Simplify

* Use random mnemonic phrase

* More clean up

* Add comment

* refactor EIP-712 signer tests into util

* update changeset to patch core

---------

Co-authored-by: Tony D'Addeo <tony@merklemanufactory.com>
Co-authored-by: Paul Fletcher-Hill <pfletcherhill@gmail.com>
2023-04-27 12:40:35 -04:00
Sanjay
427ced4f1b feat: Remember bad peers during sync and ignore them for a while. (#920)
This helps reduce excessive sync attempts (attempting to sync
with a peer that's catching up for the first time, sync divergence
prefix bugs, etc)
2023-04-26 20:40:04 -07:00
Sanjay
421c385453 feat: Add sync stats to getInfo call (#916)
* refactor: Rename sync events flag for clarity

* feat: Add sync statuts to HubInfo RPC call

* feat: Add sync stats to getInfo rpc call

* re-patch hub-web to use default export as before

* changeset
2023-04-25 10:40:59 -07:00
Sanjay
4fc319812e fix: Dedup eth events retries by block number to save api calls (#917) 2023-04-25 10:40:42 -07:00
Sanjay
5cee2c5526 fix: Fix off by one error when retrying id registry event on sync (#899)
* fix: Fix off by one error when retrying id registry event on sync

* feat: Add a command line flag to resync eth events from the beginning

* Add changeset
2023-04-20 18:18:49 -07:00