Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

LRU-based ordering buffer #327

Merged

Conversation

devintegral2
Copy link
Contributor

  • ordering buffer: use LRU instead of time-based GC. It guarantees that no more than N events are stored in RAM
  • event checks: time check against self-parent
  • fix races, refactor

@devintegral2 devintegral2 requested a review from a user September 17, 2019 03:04
devintegral pushed a commit that referenced this pull request Sep 17, 2019
Merge pull request #327 from devintegral2/feature/lru_ordering
@devintegral devintegral merged commit cad6c32 into Fantom-foundation:scope2 Sep 17, 2019
@@ -169,8 +165,8 @@ func (p *Poset) processKnownRoots() *election.ElectionRes {
// Event order matter: parents first.
// ProcessEvent is not safe for concurrent use.
func (p *Poset) ProcessEvent(e *inter.Event) error {
if e.Epoch != p.EpochN {
return epoch_check.ErrNotRecent
if err := epoch_check.New(&p.dag, p).Validate(e); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider to cache an epochCheck (epoch_check.New(&p.dag, p)) per poset.
Line 58, 168: epoch_check.New(&p.dag, p).Validate(e) => possibly store a local boolean in the poset for e, if validation takes time.

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.

None yet

3 participants