Skip to content

cmd, consensus, eth: split ethash related config to it own#15520

Merged
karalabe merged 4 commits into
ethereum:masterfrom
rjl493456442:split_ethash_config
Nov 24, 2017
Merged

cmd, consensus, eth: split ethash related config to it own#15520
karalabe merged 4 commits into
ethereum:masterfrom
rjl493456442:split_ethash_config

Conversation

@rjl493456442
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

Generally good, just a minor refactor is needed.

PowFake bool
PowTest bool
PowShared bool
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please name this struct simply Config. We're in the ethash package, so your naming would stutter ethash.EthashConfig.

Comment thread consensus/ethash/ethash.go Outdated
dagdir string // Data directory to store full mining datasets
dagsinmem int // Number of mining datasets to keep in memory
dagsondisk int // Number of mining datasets to keep on disk
EthashConfig
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't really like when fields from multiple structs are mixed together. It would be cleaner to just have a private config field for Config.

Comment thread eth/backend.go Outdated
// Otherwise assume proof-of-work
switch {
case config.PowFake:
case config.Ethash.PowFake:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think here you can swap out config from *eth.Config to *ethash.Config.

@karalabe karalabe added this to the 1.8.0 milestone Nov 23, 2017
@rjl493456442
Copy link
Copy Markdown
Member Author

@karalabe Updated

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

I really like this change :) 2 minor fixups and it's ready to go in.

Test
Fake
FullFake
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please prefix these with Mode so that they are:

d.release()
}

type Mode uint
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please document this:

// Mode defines the type and amount of PoW verification an ethash engine makes.

@rjl493456442
Copy link
Copy Markdown
Member Author

@karalabe Please take a look again!

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM!

@karalabe karalabe merged commit f14047d into ethereum:master Nov 24, 2017
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