Check out the Issue Explorer
Looking to fund some work? You can submit a new Funded Issue here.
## What's Wrong
When using `geth --dev`, it uses a proof-of-authority chain for instant mining. Unfortunately, the mechanism for PoA is to add a bunch of bytes to `extraData`, which is not yellow-paper-compliant. We would like to have the default web3.py strictly reject non-compliant clients, but still enable people to use this popular development alternative.
## Proposed Solution
Add a new middleware, called something like `truncate_extra_data_middleware`. It would trim the extraData field down to 32 bytes or fewer. Note that this would be best to go earlier in the middleware stack than the pythonic middleware, which raises the exception.
To be complete:
- [ ] A test showing that a long extradata does not raise an error, after adding the new middleware
- [ ] A test showing that a long extradata **does** raise an error in the default configuration
- [ ] A new middleware `truncate_extra_data_middleware` (probably constructed with a more general `construct_truncate_result_middleware(whitelist_methods, field, truncate_to)`)
- [ ] Add to the API for the middleware stack (probably). Either something like `.bury(obj)` which puts a new middleware to the bottom of the stack, or a more general `.insert(pos, obj)` which inserts middleware to an arbitrary location. Up for discussion.
- [ ] Some basic documentation describing why and how to use the new middleware
## Original Issue
Getting the following error message when trying to send a transaction via web3py:
> Error Could not format value '0xd783010800846765746887676f312e392e32856c696e7578000000000000000086ddf484c77c385bf8ec5c04427ccb3b2624efc39c966ae16858213df5f87ca453022c474a9346faec0be34f6ec2c16da2a987fd08670465c3b70bb361848a8a00' as field 'extraData'
Here is the script im using