karmacoma 82204fef6f perf: discard old contact info messages early (#1710)
## Motivation

When processing a contact info message, the old behavior was:

1. hashing the content, verifying the signature
2. then checking the timestamp and discarding the message if it's too
old

The new behavior just inverts the order of these two operations, so we
avoid doing expensive work if we're going to discard the message.

Please advise on how to add a test for this, at least it doesn't break
any existing tests.

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [ ] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [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 improving the message processing in the `Hub` class
of the Hubble application. The notable changes include:

- Added a check to ignore messages that are too old
- Added validation for message signatures if present
- Updated the address book for the peer

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

<!-- end pr-codex -->
2024-02-28 22:02:39 -08:00
2024-02-26 18:27:42 -06:00
2022-03-16 17:46:07 -07:00
2022-12-08 14:02:11 -08:00
2023-09-23 10:23:23 -05:00

Hubble Monorepo

This monorepo contains Hubble, an official Farcaster Hub implementation, and other packages used to communicate with Hubble.

Getting Started

  1. To run Hubble, see the Hubble docs.
  2. To use Hubble, see the hub-nodejs docs.
  3. To use the HTTP API to read Hubble data, see the HTTP API docs

Packages

Package Name Description
@farcaster/hubble A Farcaster Hub implementation
@farcaster/hub-nodejs A Node.js client library for Hubble
@farcaster/hub-web A Browser client library for Hubble
@farcaster/core Shared code between all packages

Contributing

Please see CONTRIBUTING.md

Description
No description provided
Readme MIT 54 MiB
Languages
TypeScript 91.7%
Rust 8.1%
Go 0.1%