bloxbean / aiken-java-binding

A Java binding for Aiken
MIT License
5 stars 1 forks source link

Fix budgets #4

Closed matiwinnetou closed 1 year ago

matiwinnetou commented 1 year ago

Apparently it is mem = 14000000L

on main-net, not 16000000L

This raises interesting question if we should be keeping default or rather read default from Aiken... all defaults.

data source: https://cexplorer.io/params

satran004 commented 1 year ago

Thanks @matiwinnetou. Let's merge this for now.

We can add another method in Aiken JNA wrapper layer without InitialBudget and remove default from java code.

So, a Java app can use

  1. TxEvaluator() - This will use default initial budget config defined in Aiken. Need to check if Aiken also has a default SlotConfig?
  2. TxEvaluator(slotConfig, initialBudgetConfig) - Use application provided slotConfig and initialBudgetConfig

Issue

matiwinnetou commented 1 year ago

Yes but I am not sure which one is the correct approach, relying on SlotConfig and InitialBudget from Aiken or managing this in java layer. Keep in mind that Aiken team will likely forget to keep this updated.

These params can be updated on main-net within one epoch and in addition when running devnets, on Hydra, these parameters can be vastly different than defaults.

IMHO, ideal approach would be to always read those params in an app (based on live settings + some cache) and always pass them down the invocation stack.