-
Notifications
You must be signed in to change notification settings - Fork 679
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
Block class to vm #640
Block class to vm #640
Conversation
evm/utils/pipe.py
Outdated
@@ -0,0 +1,16 @@ | |||
def pipe_accumulator(base_state, transformer, inputs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This felt like a good thing that might make sense to reuse a lot.
The idea is that we care about two things when applying a sequence of transforms: the final state (note I mean state in a general way, not VMState
), and the list of artifacts produced along the way. In the context of applying transactions, we care about the final header, and all the receipts/computations produced along the way.
So with two inputs, like this:
input0 input1
| |
v v
state0 --> transform() -- --state1--> transform() -- --state2-->
| |
v v
artifact1 artifact2
We want state2
and (artifact1, artifact2)
. The base case of "no inputs" should generate an output of state0
and (, )
.
I'll put that ^ diagram in the comments before merging
On the name: I also sort of like the name pipe_map
for this method. Any other suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to drop this commit because I like the idea of the transform generating a state-diff better. I'll come back to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
accumulation_pipe
pipe_and_accumulate
transform_and_accumulate
apply_and_accumulate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to address this section in a subsequent PR or is this a WIP?
Since this PR got lighter without the |
Ok, ready for you @pipermerriam |
What was wrong?
Related to #599 & #507
block_class
at allHow was it fixed?
block_class
to VMpipe_accumulator
to handle this case, and hopefully others.Cute Animal Picture