[COIN 584] [XTZ] Improve Fees and GasLimit using a RPC node#643
[COIN 584] [XTZ] Improve Fees and GasLimit using a RPC node#643gagbo wants to merge 8 commits intoLedgerHQ:developfrom
Conversation
af783b4 to
7787ace
Compare
| static const auto bogusSignature = | ||
| "edsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29" | ||
| "CvVzgi7qEcEUok3k7AuMg"; | ||
| vString.SetString( | ||
| bogusSignature, | ||
| static_cast<SizeType>(std::strlen(bogusSignature)), | ||
| allocator); | ||
| opObject.AddMember("signature", vString, allocator); |
There was a problem hiding this comment.
Why do we need to put a fake signature here / what happens if we don't? (Tezos noob question)
There was a problem hiding this comment.
the node refuses to make the operation simulation with an error
core/src/wallet/tezos/explorers/ExternalTezosLikeBlockchainExplorer.cpp
Outdated
Show resolved
Hide resolved
| const std::string picoTezGasPrice = api::BigInt::fromDecimalString(apiGasPrice, 6, ".")->toString(10); | ||
| return std::make_shared<BigInt>(std::stoi(picoTezGasPrice)); |
There was a problem hiding this comment.
Why not just return the result of api::BigInt::fromDecimalString here?
There was a problem hiding this comment.
because when I use BigInt->toInt64 later I don't know if I get 500 or 50 for a value like "0.50"
|
(Only the comment on |
ghost
left a comment
There was a problem hiding this comment.
Seems all good, for a non-Tezos-expert though.
Thanks for the answers to my questions.
89159a4 to
98982fb
Compare
|
HODL it blocks reveal for now |
Those are accessible through account/TxBuilderRequest API
98982fb to
7c31a70
Compare
All issues are fixed and accounted for, but for the time being it's a pile of hacks in |
|
TODO: investigate on which branches this code is live |
Fix
Compute the "mean fees" of last block by actually dividing the total fees by the number of non trivial ops
Improvements to gasLimit and fee estimations
run_operationendpoint on a RPC node. The binary serialization did not work well with the endpoint and the error messages are harder to act onTo make the automatic estimation this is currently an admittedly bad hack to keep the current request API backwards compatible:
"0"in the request"0"there, then the transaction builder will fetch the gasPrice from the next block (which can be 0 for an empty block)Then on transaction building, Core detects the 2 info to actually make a transaction with the correct gasLimit and the associated fees according to your fee price. Note that there are no guarantees that the fees amount won't be too high for the sender's balance, callers should check this before signing/broadcasting.