-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[COIN 584] [XTZ] Improve Fees and GasLimit using a RPC node #643
base: develop
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just return the result of api::BigInt::fromDecimalString
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_operation
endpoint 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.