Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Make Solidity MIPS faster! #16

Closed
geohot opened this issue Oct 4, 2021 · 4 comments
Closed

Make Solidity MIPS faster! #16

geohot opened this issue Oct 4, 2021 · 4 comments

Comments

@geohot
Copy link
Collaborator

geohot commented Oct 4, 2021

It's running 5M+ instructions without issue now, but it's a bit too slow to use in practice. I really don't want to maintain two implementations.

Profile and optimize, the dream is to run small blocks in 1 minute and large blocks in 10.

We can of course fast forward to the input oracle read, but that's meh.

@geohot
Copy link
Collaborator Author

geohot commented Oct 5, 2021

It's running at 85khz now.

@geohot
Copy link
Collaborator Author

geohot commented Oct 5, 2021

73610000 steps to validate a 5 tx block. That's 14.4 minutes...too slow.

It's over 1B instructions for a reasonable block. Need speed of 2 MHz for this to work, 23x faster.

772 EVM ops / MIPS op. This can be reduced a lot. (can it?)

evm runs at ~50mhz. 40 x86 ops / EVM op.

@geohot
Copy link
Collaborator Author

geohot commented Oct 6, 2021

Starting to just accept we'll have to have two implementations, one using unicorn and one using mipsevm.

Though, before responding to a challenge, we can check all the transitions in parallel from checkpoints (generated with unicorn, say every 1M instructions + start/end). 24 cores = 23x. The checkpointing is needed to play the binary search game quickly anyway.

And it's about 110 kHz now (could likely be around 200 with more gas optimization, bad choice if it's too unreadable)

Also going to refactor btcec to not have a 200M instruction decompression.

@geohot
Copy link
Collaborator Author

geohot commented Oct 12, 2021

I'm happy with the speed of it now. We'll need two implementations regardless, at least one is just unicorn (aka qemu) and not custom code.

@geohot geohot closed this as completed Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant