mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 992 forks source link

rework the block context to take a mutable ref to the batch #3027

Open garyyu opened 4 years ago

garyyu commented 4 years ago

To track an improvement item here, the original discussion: https://github.com/mimblewimble/grin/pull/3004#discussion_r321166242

garyyu 2 days ago Member But I would still prefer ONE batch here, because one commit() is twice efficient than two commit() :-)

@antiochp antiochp 2 days ago • Author Member We create two separate block contexts and these both take ownership of the batch, so we can't reuse the same one.

We need to rework the block context to take a mutable ref to the batch. Pretty sure this is possible but the code gets tricky because of the lifetimes involved. Maybe tackle this in a separate PR.

garyyu commented 4 years ago

@garyyu I assigned this to you if you don't mind :-)

antiochp commented 4 years ago

Lets leave this open for a bit to remind us (but reserving the right to close it out unfixed...) I'm not a huge fan of tracking too much "work in progress" - particularly if it just sits and is not actively worked on. If this is important we will pick it up at a later date regardless of whether its tracked by an issue like this.