anagrambuild / bonsol

solana + risc0
https://bonsol.sh
GNU Affero General Public License v3.0
60 stars 9 forks source link

Create a execution cost estimation mechanism for program developers. #78

Open austbot opened 1 month ago

austbot commented 1 month ago

According to the output #27 the developer must provide and upper bound on the execution cost of the executing program. This is easily doable using available tools, but the tricky part is the estimation given dynamic input sizes. Given that use of the zkvm guest sort of required you to know the size of your inputs or at least the order of magnitude it is acceptable to assume the inputs would be within the same order of magnitude and a executor statistic will be sufficient for estimating the programs cost to run

eureka-cpu commented 5 days ago

I see two ways of handling the inputs:

  1. bake the varying inputs into multiple ELFs with small, medium and large input sizes (the easier of the two options)
  2. actually use dynamic inputs during emulation (this would require re-writing some of the code for running emulations I think.. Will ask in the risc0 discord if this is already doable and I've just missed something)