According to Monero source code there are two metrics for the transaction size:
Size
https://github.com/monero-project/monero/blob/v0.17.2.0/src/wallet/wallet2.cpp#L870Weight
https://github.com/monero-project/monero/blob/v0.17.2.0/src/wallet/wallet2.cpp#L878
There is Wallet RPC method returning them both estimate_tx_size_and_weight
: https://github.com/monero-project/monero/blob/v0.17.2.0/src/wallet/wallet2.cpp#L14187 and https://github.com/monero-project/monero/blob/v0.17.2.0/src/wallet/wallet_rpc_server.cpp#L4317
I'm trying to understand how that metrics are related to real transaction size, for example:
- https://localmonero.co/blocks/tx/82966ee2ade89b159b80bc376b608cc9e8e8cd3b5206abcac267984414fee8f0 real size: 1452 estimated size: 1460 weight: 1460 - both differs by 8 bytes
- https://localmonero.co/blocks/tx/46a36725ed36e624fc8de94ed79943284639d4e524d600b0367297f7c575bc01 real size: 1966 estimated size: 1969 weight: 1969 - both differ by 3 bytes
- https://localmonero.co/blocks/tx/de4b645e96be1d98b2e753a450b433b5ab2916c2911c0a4a6736cbe43a4624bf real size: 3700 but estimated size: 3253 weight: 7221 - it seems no size and no weight are related to real size because so big difference
What's wrong with the estimation or maybe I don't understand some logic behind?