-
Notifications
You must be signed in to change notification settings - Fork 103
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
Configurable stratum diff, block refresh, and extranonce #59
Conversation
This has been working great for me, and closes #43. |
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.
Thanks for doing this, just one comment around changing the block wait to a duration instead of a naked string everywhere
// static value definitions to avoid overhead in diff translations | ||
var ( | ||
maxTarget = big.NewFloat(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) | ||
minHash = new(big.Float).Quo(new(big.Float).SetMantExp(big.NewFloat(1), 256), maxTarget) |
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.
really rolls right off the tongue
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.
haha yeah, don't love that representation, but i do think it's actually more clear than the bitshifting, and from what i've read, direct assignments are often faster, due to the compiler actually understanding the intention - not that it matters much for a single assignment. mainly i was struggling to wrap my head around the different representations, and was hoping this and the accompanying changes re: target/diff clarified things a bit.
src/kaspastratum/stratum_server.go
Outdated
@@ -21,6 +22,9 @@ type BridgeConfig struct { | |||
PrintStats bool `yaml:"print_stats"` | |||
UseLogFile bool `yaml:"log_to_file"` | |||
HealthCheckPort string `yaml:"health_check_port"` | |||
BlockWaitTime string `yaml:"block_wait_time"` |
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.
change this from a string to a time.Duration? It'll make life easier later on. You can parse it directly using flag.DurationVar
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.
sure... was just following existing style, and am also new to go, so didn't dive in too deep. Will take a look.
@@ -60,8 +60,12 @@ func TestHeaderSerialization(t *testing.T) { | |||
} | |||
|
|||
func TestPoolHzCalculation(t *testing.T) { | |||
log.Println(shareValue) | |||
log.Println(fixedDifficulty) | |||
// TODO: figure out what we really want to test here. |
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.
Yeah this was a thing then I deleted it for whatever reason.
Hi guys! Any chance this pull request will be approved? |
…requires prometheus changes to work)
Ok, all three flags updated to appropriate types. Sorry, should have been doing this from a branch - now i have a couple other minor updates included.
|
@rdugan can you do a quick bullet-point writeup on everything you changed/added and I'll throw in in the release notes with a shoutout. Also on how to use the new flags :) Appreciate the work! |
@onemorebsmith There's nothing really worth mentioning beyond the bullets in my original comment here. Maybe just remove the diff instantiation comment, as it's unnecessary detail for the release notes? Also, the config params are pretty extensively documented in the config.yaml file. |
Three new configurable features, with defaults set to previous values:
Also cleaned up CLI output a bit, including block counting.