Skip to content

Finalizer based on LMD votes, not connected to actual balances yet - #52

Closed
leolara wants to merge 10 commits into
wealdtech:masterfrom
leolara:leolara/lmd-finalizer
Closed

leolara wants to merge 10 commits into
wealdtech:masterfrom
leolara:leolara/lmd-finalizer

Conversation

@leolara

@leolara leolara commented Jun 27, 2022

Copy link
Copy Markdown

No description provided.

@leolara
leolara force-pushed the leolara/lmd-finalizer branch 4 times, most recently from eb2c76b to fafc325 Compare June 28, 2022 07:57
@leolara
leolara force-pushed the leolara/lmd-finalizer branch from fafc325 to 1d713fa Compare June 29, 2022 13:10
Comment thread services/blocks/standard/lmdfinalizer/tree/node.go
}

// New LMDFinalizer with logger `log`.
func New(latestFinalized *chaindb.Block, log zerolog.Logger, handler newLFBHandler) LMDFinalizer {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is already starting to be overloaded with parameters. Using the .WithX() parameter system that is used in other modules in chaind would make this easier to use.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The first two are kind of mandatory. I guess I can make log optional. Do you want me to add a WithX() for latestFinalized?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, ideally everything but the context would be a parameter as it makes future changes significantly easier to manager (for example, if we wanted to allow multiple handlers we could just add a WithHandlers() alongside the additional WithHandler() and it would not break any existing code.

Comment thread services/blocks/standard/lmdfinalizer/finalizer.go Outdated
@leolara leolara closed this May 23, 2025
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.

2 participants