Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2P module #36

Merged
merged 24 commits into from
Mar 21, 2023
Merged

P2P module #36

merged 24 commits into from
Mar 21, 2023

Conversation

spypsy
Copy link
Member

@spypsy spypsy commented Mar 9, 2023

Description

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.

@spypsy spypsy changed the title Engineer can start the P2P module P2P module Mar 10, 2023
* Helper to tranform Buffer IDs to a bigint.
*/
// TODO: place in/use from foundation repo
const toBigInt = (buf: Buffer): bigint => {
Copy link
Collaborator

@ludamad ludamad Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably make an eslint rule for this, but I'm recommending we import {Buffer} from "buffer" as the rules for how modules are poly-filled is clearer than for globals

Copy link
Member Author

@spypsy spypsy Mar 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, that actually sounds nice as I'm often fighting with the IDE to recognise that Buffer is a node env global.
This particular case will be removed shortly as I'm moving these into the foundation repo but I think this is a good idea 👍

@spypsy spypsy changed the base branch from master to pw/world-state-sync March 14, 2023 18:23
@spypsy spypsy changed the base branch from pw/world-state-sync to master March 14, 2023 18:39
@spypsy spypsy changed the base branch from master to pw/world-state-sync March 16, 2023 17:59
@PhilWindle PhilWindle merged commit a1a7d34 into pw/world-state-sync Mar 21, 2023
PhilWindle added a commit that referenced this pull request Mar 23, 2023
* Initial work on synching world state

* WIP

* WIP

* WIP

* WIP

* docs: fixed memory_fifo docs

* refactor+docs: updated naming + fixed docs in L2BlockDownloader

* refactor+docs: updated naming + fixed docs in Synchronizer

* docs: fixed Semaphore docs

* docs: fixed SerialQueue docs

* docs: fixed docs in InterruptableSleep

* docs: fixed WorldStateSynchroniser interface

* docs: fixed WorldStatedB docs

* docs: finished fixing world state docs

* docs: fixed StandardMerkleTree docs

* docs: fixed SiblingPath docs

* docs: fixed docs of serialise.ts

* docs: fixed MerkleTree docs

* docs: fixed IndexedTree docs

* docs: other merkle tree fixes

* docs: fixed archiver

* docs: fixed running promise docs

* WIP

* P2P module (#36)

* add basic p2p client declarations for starting

* WIP adding basic properties to p2p client

* basic in-memory tx pool

* super high-level implementation of p2p client initial sync

* add public stop function to p2p client

* add txPool to p2p client constructor

* add functions to get all txs from tx pool & p2p client

* add base p2p test

* add yarn start - start:dev

* consolidate some temp types etc

* reject txs after being stopped

* p2p running sync promise

* add client state to status response

* tx pool tests + cleanup

* add world-state to yarn-project-base dockerfile

* add merkle-tree to yarn-project-base-dockerfile

* update project references + VERY BASIC implementation of Accumulated Tx Data

* use types from data-archiver

* merge fixes

* update to use l2 blocks from archiver

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Renamed public client

* Removed serialisation code from merkle tree project

* WIP

* WIP

* WIP

---------

Co-authored-by: benesjan <[email protected]>
Co-authored-by: spypsy <[email protected]>
@charlielye charlielye deleted the sp/p2p-client-start branch March 28, 2023 21:19
ludamad pushed a commit that referenced this pull request Apr 14, 2023
ludamad pushed a commit that referenced this pull request Apr 17, 2023
ludamad pushed a commit that referenced this pull request Apr 17, 2023
ludamad pushed a commit that referenced this pull request Jul 19, 2023
ludamad pushed a commit that referenced this pull request Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants