-
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
miner: add support for --miner.notify.full flag #22558
Conversation
Co-authored-by: Martin Holst Swende <martin@swende.se>
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.
Some of these changes look wrong to me
case ethash.ModeTest: | ||
log.Warn("Ethash used in test mode") | ||
return ethash.NewTester(nil, noverify) |
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.
The NewTester
did some more stuff that is now skipped:
func NewTester(notify []string, noverify bool) *Ethash {
ethash := &Ethash{
config: Config{PowMode: ModeTest, Log: log.Root()},
caches: newlru("cache", 1, newCache),
datasets: newlru("dataset", 1, newDataset),
update: make(chan struct{}),
hashrate: metrics.NewMeterForced(),
}
ethash.remote = startRemoteSealer(ethash, notify, noverify)
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.
The code in NewTester
was just a copy of the normal constructor. I've fixed it now to just call that instead.
case ethash.ModeShared: | ||
log.Warn("Ethash used in shared mode") | ||
return ethash.NewShared() |
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.
The idea here is to use a shared instance, but that's just ignored in these changes...?
func NewShared() *Ethash {
return &Ethash{shared: sharedEthash}
}
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.
This is now fixed as well. The main constructor New
, now sets shared
when ModeShared
is used.
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.
Looks ok to me
…thereum#22558) The PR implements the --miner.notify.full flag that enables full pending block notifications. When this flag is used, the block notifications sent to mining endpoints contain the complete block header JSON instead of a work package array. Co-authored-by: AlexSSD7 <alexandersadovskyi7@protonmail.com> Co-authored-by: Martin Holst Swende <martin@swende.se>
This is a resubmit of #22323 with some additional fixes.
The PR implements the
--miner.notify.full flag
that enables full pending block notifications. Extends--miner.notify
flag.Notification without this flag:
Notification with this flag: