reth icon indicating copy to clipboard operation
reth copied to clipboard

refactor: replace ValidationError string with PayloadValidationError enum

Open TechieBoy opened this issue 2 years ago • 4 comments

closes #2720

Do we also need to create seperate PayloadValidationError variants for every consensus/Execution error?

https://github.com/paradigmxyz/reth/blob/5039122c356f20d36e3d5979f0da97a2fc40ac75/crates/consensus/beacon/src/engine/mod.rs#L743-L746

TechieBoy avatar May 24 '23 06:05 TechieBoy

Codecov Report

Merging #2803 (a29c38d) into main (91dd782) will decrease coverage by 27.12%. The diff coverage is 0.00%.

Impacted file tree graph

Impacted Files Coverage Δ
crates/rpc/rpc-types/src/eth/engine/payload.rs 30.89% <0.00%> (-56.50%) :arrow_down:

... and 257 files with indirect coverage changes

Flag Coverage Δ
integration-tests 15.88% <0.00%> (-0.01%) :arrow_down:
unit-tests 33.98% <0.00%> (-30.12%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 10.74% <ø> (-15.61%) :arrow_down:
blockchain tree 69.93% <ø> (-11.33%) :arrow_down:
pipeline 49.75% <ø> (-36.93%) :arrow_down:
storage (db) 54.01% <ø> (-19.48%) :arrow_down:
trie 58.94% <ø> (-35.73%) :arrow_down:
txpool 30.28% <ø> (-18.71%) :arrow_down:
networking 45.03% <ø> (-32.80%) :arrow_down:
rpc 33.81% <0.00%> (-24.31%) :arrow_down:
consensus 36.74% <ø> (-26.62%) :arrow_down:
revm 18.87% <ø> (-15.99%) :arrow_down:
payload builder 6.83% <ø> (ø)
primitives 49.89% <ø> (-38.39%) :arrow_down:

codecov-commenter avatar May 24 '23 07:05 codecov-commenter

okay, so let's get rid of all the deserialize impls?

mattsse avatar Jun 05 '23 19:06 mattsse

okay, so let's get rid of all the deserialize impls?

yeah

Rjected avatar Jun 05 '23 21:06 Rjected

@Rjected @mattsse what's the path forward here?

onbjerg avatar Jun 19 '23 11:06 onbjerg

After thinking about it, to remove the Deserialize impl we would have to remove it from a bunch of other engine API types. This might be fine, since we only actually serialize those types afaik. Including a more rich type in an error field that needs to be deserialized requires parsing the error, which is why the Deserialize impls are so involved.

I think it's fine to remove the Deserialize impls, but it's a bit more work than I thought so that would be the next steps here.

Rjected avatar Jul 07 '23 19:07 Rjected

I thought about this a bit,

and I no longer support replacing string with an enum, because this just further complicates things, it's okay to treat this as a simple error message.

I kept the tests though, ty!

mattsse avatar Jul 10 '23 11:07 mattsse