Pytezos function fill is very slow

Viewed 38

I'm trying to make a transaction with PyTezos. But in order of calculate the fees, I have to use the method fill() or autofill(). But those functions take a lot of time to process, so I suppose they are doing call to the tezos node, but why is it ?

Shouln't those function just have to calculate the size of the request and estimate the gas needed ?

1 Answers

In order to build a transaction you have to made several node requests. Part of them can be cached, although you still have to make them at least once.

Here are these requests:

  1. Chain ID
  2. Current protocol hash
  3. Protocol constants
  4. Branch (hash of some block in the past, used to adjust TTL)
  5. Counter

But the most time consuming part is fee estimation which requires dry-run simulation (another RPC call).

Related