Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Bundle pool + mutex fix #29

Closed
wants to merge 3 commits into from
Closed

Bundle pool + mutex fix #29

wants to merge 3 commits into from

Conversation

dmarzzz
Copy link
Member

@dmarzzz dmarzzz commented Dec 16, 2022

📝 Summary

What

This PR has 2 main changes:

  1. It moves all bundle related functions and data structures out of core/tx_pool.go into core/bundle_pool.go.
  2. Uses a bundle specific mutex Does AddMevBundle need to use global pool mutex ? #7

Why

  1. I personally find it easier to maintain forks by separating files, and it also allows us to test the bundle pool more easily. Happy to revert if theres good reason not to make this change!
  2. The mutex used by the current bundle functionality in core/tx_pool.go is shared by other functions in the txpool. Depending on your mempool size this could cut locks considerably.

Testing

  • Added a new test file for bundles
  • Running this code on private network right now with no issues. That being said I will be doing more testing on a private network tomorrow to see if theres any noticeable performance difference.

📚 References

#7

@dmarzzz
Copy link
Member Author

dmarzzz commented Dec 16, 2022

just now seeing theres a build error, will check that out shortly

@dmarzzz
Copy link
Member Author

dmarzzz commented Jan 3, 2023

hey @Ruteri , didn't have time to fix this test failure over the holidays but curious if y'all are interested in this PR? If not I can submit another w/ just the mutex change.

return nil
}

func (pool *TxPool) MevBundles(blockNumber *big.Int, blockTimestamp uint64) []types.MevBundle {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm, not sure if moving the txpool parts in the additional file won't be prone to later rebase issues and confusion

@Ruteri
Copy link
Collaborator

Ruteri commented Jan 3, 2023

hey @Ruteri , didn't have time to fix this test failure over the holidays but curious if y'all are interested in this PR? If not I can submit another w/ just the mutex change.

I think the changes are worthwile, and if you fix the build issues we'll merge

avalonche pushed a commit that referenced this pull request Feb 7, 2023
* do not fetch bundle if empty block num during the startup
@dmarzzz dmarzzz closed this Mar 3, 2023
avalonche pushed a commit that referenced this pull request Mar 9, 2023
* do not fetch bundle if empty block num during the startup
avalonche pushed a commit that referenced this pull request Mar 15, 2023
* do not fetch bundle if empty block num during the startup
avalonche pushed a commit that referenced this pull request Mar 17, 2023
* do not fetch bundle if empty block num during the startup
avalonche pushed a commit that referenced this pull request Mar 22, 2023
* do not fetch bundle if empty block num during the startup
@dmarzzz dmarzzz mentioned this pull request Apr 8, 2023
1 task
avalonche pushed a commit that referenced this pull request Jul 6, 2023
* do not fetch bundle if empty block num during the startup
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants