AndreaLanfranchi / EthereumStratum-2.0.0

Draft work for possible EIP
GNU General Public License v3.0
6 stars 5 forks source link

Send block number #2

Closed chfast closed 6 years ago

chfast commented 6 years ago

I like the mining.set approach. The difficulty was changed to boundary hash, right?

However I think the epoch seed is useless there. We don't want to perform the epoch seed to epoch number search.

Instead the block number should be included in the mining.notify package.

AndreaLanfranchi commented 6 years ago

The difficulty was changed to boundary hash, right?

Yes ! This approach is more efficient than the one implemented in 1.0.0 where the difficulty is passed as index-of-difficulty or, in absence, the miner must assume a boundary of "0x00000000ffff0000000000000000000000000000000000000000000000000000"

I too agree we should not pass the seed hash rather the epoch number. I will amend.

I also believe all hex - when related to numeric values (eg. the hash rate) - should be reduced to the lowest possible number of meaningful bytes instead of being fixed to 32 bytes.

chfast commented 6 years ago

Well, the hex encoding and 0x prefix is never ending story. The 0x is overused for indicating hex encoding of bytes. I would be ok with specifying the 0x values as integers then removing the leading zeros is ok by definition.

peterbitfly commented 6 years ago

Currently the block number is only included in getWork packages produced by parity. Geth just sends the pow hash, seed hash & difficulty. If it is required to submit the block number with each mining.notify package it would make sense to create a PR for Geth to include the block number in the response (should be a trivial change) as well.

AndreaLanfranchi commented 6 years ago

@chfast

Well, the hex encoding and 0x prefix is never ending story. The 0x is overused for indicating hex encoding of bytes. I would be ok with specifying the 0x values as integers then removing the leading zeros is ok by definition.

Totally agree. Please review last commit.

AndreaLanfranchi commented 6 years ago

@chfast

https://github.com/AndreaLanfranchi/EthereumStratum-2.0.0/blob/master/Draft.md#conventions-1

AndreaLanfranchi commented 6 years ago

Closing. Please open issues on specific topics.