✨ Fully rewrite relay
This commit is contained in:
parent
190e38dfc1
commit
20ffbd4c6d
47 changed files with 3489 additions and 128 deletions
44
consts.ts
44
consts.ts
|
@ -1,44 +0,0 @@
|
|||
/**
|
||||
* Minimum required Proof of Work (PoW) difficulty for note acceptance.
|
||||
*
|
||||
* Notes with PoW below this threshold will be rejected without decryption attempts.
|
||||
* This threshold serves as a DoS protection mechanism for the CCN in case of
|
||||
* public key compromise.
|
||||
*/
|
||||
export const MIN_POW = 8;
|
||||
|
||||
/**
|
||||
* Target Proof of Work (PoW) difficulty for relay-generated notes.
|
||||
*
|
||||
* Defines the PoW difficulty level that the relay will compute when generating
|
||||
* and encrypting its own notes before broadcasting them to the network.
|
||||
*
|
||||
* Expected Performance on modern hardware (2025):
|
||||
* - Difficulty 8: ~1ms
|
||||
* - Difficulty 21: ~5-6 seconds
|
||||
*/
|
||||
export const POW_TO_MINE = 10;
|
||||
|
||||
/**
|
||||
* Maximum size of a note chunk in bytes.
|
||||
*
|
||||
* This value determines the maximum size of a note that can be encrypted and
|
||||
* sent in a single chunk.
|
||||
*/
|
||||
export const MAX_CHUNK_SIZE = 32768;
|
||||
|
||||
/**
|
||||
* Interval for cleaning up expired note chunks in milliseconds.
|
||||
*
|
||||
* This value determines how often the relay will check for and remove expired
|
||||
* note chunks from the database.
|
||||
*/
|
||||
export const CHUNK_CLEANUP_INTERVAL = 1000 * 60 * 60;
|
||||
|
||||
/**
|
||||
* Maximum age of a note chunk in milliseconds.
|
||||
*
|
||||
* This value determines the maximum duration a note chunk can remain in the
|
||||
* database before it is considered expired and eligible for cleanup.
|
||||
*/
|
||||
export const CHUNK_MAX_AGE = 1000 * 60 * 60 * 24;
|
Loading…
Add table
Add a link
Reference in a new issue