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

Optimize push operation by removing duplications #483

Open
JeongHunP opened this issue Aug 3, 2023 · 0 comments
Open

Optimize push operation by removing duplications #483

JeongHunP opened this issue Aug 3, 2023 · 0 comments

Comments

@JeongHunP
Copy link
Contributor

JeongHunP commented Aug 3, 2023

Currently, git push operation is executed by broadcast function inDistributedRepository module.
It is used to broadcast local changes to the remote repository, however, it is slow due to the repeated push operations.
You can see how many push operations are executed when you run cli in cli/tests/e2e.rs or normal_1 in simperby/tests/integration_test.rs. As client nodes sync each other by broadcasting to the server node, they repeatedly push same local changes(agenda/agenda proof/block/fp branches).
So, we should optimize the number of push operation by storing the past pushed branches like caches.

What you should do is

  1. Run above tests and see how many push operations are executed during making and syncing just one block.
  2. Introduce appropriate data structure to store the branches that pushed.
  3. Change broadcast in repository/interpret/push.rs by using the new data structure.
  4. Please check by running the same tests and see results.

Requirements

  1. New data structure to store the pushed branches are the member of DistributedRepository struct.
  2. As local branches which will be pushed are usually attached to the most recent block, it is better to flush(remove all) the content of storage as the block height increases.
  3. Each remembered branches should be stored each remote repositories.
  4. It stores commit hashes, not branch names.
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

No branches or pull requests

1 participant