[ETCM-43][ETCM-46] Add opt-out field#675
Conversation
3f62ec0 to
0bea179
Compare
0bea179 to
da98f44
Compare
be1e679 to
a97f773
Compare
| atlantis-block-number = "0" | ||
| agharta-block-number = "0" | ||
| phoenix-block-number = "0" | ||
| # FIXME: Once the testnet is up an running we should determine this value |
There was a problem hiding this comment.
maybe we should provide a new file especially for the new testnet, WDTY?
There was a problem hiding this comment.
Should we still keep the configurations for a private testnet? It could get a bit messy given that we have private.conf, private.json and private-testnet.conf
We could have for our chains/ files:
- Keep private-testnet.conf (current private.conf) and private-testnet.json (current private.json), with private-testnet.conf having ecip1098 activated at block 0 as currently
- Add internal-testnet.conf and internal-tesnet.json for our testnet
We could have for our conf/ files:
- Have a testnet-changes.conf file with the testnet configuration overrides (i.e. disabling pruning and discovery)
- Have a private-testnet.conf and a internal-testnet.conf that would just select the correct chain
There was a problem hiding this comment.
maybe we could discuss this in a call.
| val isEcip1098Activated = blockHeader.number >= blockchainConfig.ecip1098BlockNumber | ||
| val isOptOutDefined = blockHeader.optOut.isDefined | ||
|
|
||
| if(isEcip1098Activated && isOptOutDefined) Right(BlockHeaderValid) |
| def getEncodedWithoutNonce(blockHeader: BlockHeader): Array[Byte] = { | ||
| val rlpEncoded = blockHeader.toRLPEncodable match { | ||
| case rlpList: RLPList => | ||
| case rlpList: RLPList if rlpList.items.length == (NumberOfFields - 1) => |
There was a problem hiding this comment.
i prefer something like: if (isPreviousToEcip1089(rlpList) => WDYT?
There was a problem hiding this comment.
I found a way I preferred most, to not require the NumberOfFields value, I'll soon push it
| case rlpList: RLPList if rlpList.items.length == (NumberOfFields - 1) => | ||
| RLPList(rlpList.items.dropRight(2): _*) | ||
|
|
||
| case rlpList: RLPList if rlpList.items.length == NumberOfFields => |
| @@ -73,8 +81,17 @@ object BlockHeader { | |||
| implicit class BlockHeaderEnc(blockHeader: BlockHeader) extends RLPSerializable { | |||
There was a problem hiding this comment.
A comment regarding the reason behind optOut match { will help future generations i guess..hehe.
| val headerWithOptOutInvalidlyOn = validBlockHeader.copy(optOut = Some(true)) | ||
|
|
||
| val validationResult = blockHeaderValidator.validate(headerWithOptOutInvalidlyOn, validParentBlockHeader) | ||
| validationResult shouldBe Left(HeaderOptOutError) |
There was a problem hiding this comment.
(minor) maybe we could provide differenciation between this scenario and the following one, i mean in terms of HeaderOptOutError description. Still not sure if is worthy, wdyt?
…more details to opt-out validation error
| mixHash = genesisData.mixHash.getOrElse(zeros(hashLength)), | ||
| nonce = genesisData.nonce, | ||
| optOut = None | ||
| treasuryOptOut = None |
Description
First changes for supporting treasury (as specified here)
Depends on #674Proposed Solution
Pending
Testing