Skip to content
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

support other seal-engines #687

Closed
simon-jentzsch opened this issue May 14, 2018 · 7 comments
Closed

support other seal-engines #687

simon-jentzsch opened this issue May 14, 2018 · 7 comments

Comments

@simon-jentzsch
Copy link
Contributor

Currently this encode and decodes only blocks as specified in the yellow paper.
it does not work with POA-Chains, since they are using different sealed_fields.
How about we use the seal_fields insted.

@holgerd77
Copy link
Member

Hi Simon, not sure if you have followed the latest developments at ethereumjs/ethereumjs-block#44 introducing support for different networks and were inspired for this issue from there.

I'm very open for an extension in this direction, actually through the new ethereumjs-common library there will also now be the possibility to request the consensus type (e.g. pow or poa) when a network and a hardfork are set.

I am no POA expert, do you want to prepare a PR for this? Or do you have someone in mind who could do? It would be also good if you could have a look at the common library if/where/what kind of POA data should be added there.

@holgerd77
Copy link
Member

Hi @simon-jentzsch, any comment on this (see my note above)?

@simon-jentzsch
Copy link
Contributor Author

Hi, yes this is implementation I coded, which serializes blockheaders from both (pow and poa):

https://github.com/slockit/in3/blob/master/src/util/serialize.ts#L146

I tested this on all testchains.

@vpulim
Copy link
Contributor

vpulim commented Nov 15, 2018

@simon-jentzsch Would you be able to incorporate your code into ethereumjs-block and submit a PR?

In addition to supporting additional seal fields for PoA, we also need to fix the validation code. Until more robust validation code is written, the following changes should be enough to loosely validate PoA blocks for now:

  1. In BlockHeader.prototype.canonicalDifficulty, the minimumDifficulty check should be skipped for non-PoW chains:
  if (dif.cmp(minimumDifficulty) === -1 && this._common.consensus(hardfork) === 'pow') {
    dif = minimumDifficulty
  }
  1. In BlockHeader.prototype.validate, the extraData.length check should be skipping for non-PoA chains:
    if (self.extraData.length > self._common.param('vm', 'maxExtraDataSize', hardfork) 
      && self._common.consensus(hardfork) === 'pow') {
      return cb('invalid amount of extra data')
    }

@holgerd77
Copy link
Member

//cc @simon-jentzsch What's the status of this?

@vpulim
Copy link
Contributor

vpulim commented Dec 6, 2018

To clarify, @simon-jentzsch's PR implements changes needed for Parity's Aura PoA protocol. However, Goerli (and Geth) use the Clique PoA protocol which does not require changes to the Block header fields.

@holgerd77
Copy link
Member

Will close, we will likely not support the Parity Aura PoA protocol and there is another more generalized PoA issue open with #689

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants