-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
les: move the checkpoint oracle into its own package #20508
Conversation
It's first step of refactor LES package. LES package basically can be divided into LES client and LES server. However both sides will use checkpoint package for status retrieval and verification. So this PR moves checkpoint oracle into a separate package
les/checkpointoracle/oracle.go
Outdated
config *params.CheckpointOracleConfig | ||
contract *checkpointoracle.CheckpointOracle | ||
|
||
running int32 // Flag whether the contract backend is set or not | ||
getLocal func(uint64) params.TrustedCheckpoint // Function used to retrieve local checkpoint | ||
} | ||
|
||
// newCheckpointOracle returns a checkpoint registrar handler. | ||
func newCheckpointOracle(config *params.CheckpointOracleConfig, getLocal func(uint64) params.TrustedCheckpoint) *checkpointOracle { | ||
// NewCheckpointOracle returns a checkpoint oracle handler. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to New
to avoid stuttering at call sites: checkpointoracle.NewCheckpointOracle
vs checkpointoracle.New
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit, otherwise LGTM
@karalabe Fixed, thanks for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* les: move the checkpoint oracle into its own package It's first step of refactor LES package. LES package basically can be divided into LES client and LES server. However both sides will use checkpoint package for status retrieval and verification. So this PR moves checkpoint oracle into a separate package * les: address comments
It's first step of refactor LES package. LES package
basically can be divided into LES client and LES server.
However both sides will use checkpoint package for
status retrieval and verification. So this PR moves
checkpoint oracle into a separate package