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

Implement Mempool #29

Open
exdx opened this issue Sep 5, 2023 · 7 comments
Open

Implement Mempool #29

exdx opened this issue Sep 5, 2023 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@exdx
Copy link
Contributor

exdx commented Sep 5, 2023

Port the Mempool type and API from avalanchego. See https://pkg.go.dev/github.com/ava-labs/[email protected] for package-level documentation.

@exdx exdx added enhancement New feature or request good first issue Good for newcomers labels Sep 5, 2023
@exdx
Copy link
Contributor Author

exdx commented Sep 5, 2023

https://pkg.go.dev/github.com/ava-labs/[email protected]/vms/platformvm/txs/mempool

@exdx
Copy link
Contributor Author

exdx commented Sep 5, 2023

See https://github.com/ava-labs/avalanchego/pull/1958/files#diff-fc671b8b3c30328876f4984afaaf43b548dd28cc886934a95a0fbcdb6788f1ae for an example of the new gossipable set interface which will be used by avalanchego VMs via the SDK in the future. The solution should likely implement this interface to be compatible.

@Sanghren
Copy link

Sanghren commented Sep 7, 2023

I'm interested in contributing (at least have a try) to this ticket. Before I start, I have a question regarding the directory structure for the implementation.

In avalanchego, the relevant code is located in vms/platformvm/txs/mempool . Should the equivalent code in avalanche-rs be placed in core/vms/platformvm/txs/mempool?

I'm asking because I noticed that the peer code in avalanchego is in network/peer, whereas in avalanche-rs, it's in core/network/src/peer.

I'd like to ensure I'm placing my contributions in the correct directories.

@exdx
Copy link
Contributor Author

exdx commented Sep 7, 2023

Thanks for looking into this.

In avalanchego historically, each vm has their own mempool implementation, leading to a lot of code duplication. We are working to provide a common library for APIs like mempool (see ava-labs/avalanchego#1958 for an example of a mempool API called Gossipable).

I think for now the best thing to do would be to implement a Gossipable trait, along with other traits in the above PR. We would like to have parity with the latest avalanchego APIs.

We can put it in https://github.com/ava-labs/avalanche-rs/tree/main/core/network/src under a p2p module for now.

@Sanghren
Copy link

I have some stuff ongoing over here : https://github.com/Sanghren/avalanche-rs/tree/add_gossipable. Not sure about everything I did though.

@exdx
Copy link
Contributor Author

exdx commented Sep 13, 2023

I have some stuff ongoing over here : https://github.com/Sanghren/avalanche-rs/tree/add_gossipable. Not sure about everything I did though.

That's great. I would open a PR and then we can take a look. It can be a draft PR if not's not fully ready.

@Sanghren
Copy link

Opened a draft PR here : #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants