bnb-chain / node-binary

Binaries for full nodes, light-weighted clients
180 stars 120 forks source link

Inconsistent fees in API and Kafka output #301

Open smalyshev opened 2 years ago

smalyshev commented 2 years ago

Looking into the data generated by the BNB node for Kafka output, I found something strange. The data from the transactions and what I see in API responses do not match. For example, for tx BCD1E9DA0D58C9B08DAA0CEEF0CA3A01E62C62F0647B89E214453DB6A6B81E4D in block 179998840, the data generated on Kafka looked like this:

'bnbTransaction': { 'code': 0,
'data': '{"sender":"bnb1vyh3zd0z57j3f3zyf3fx99c48cgq0ctwmhtjft","symbol":"CAS-167_BNB","refid":"612F1135E2A7A514C4444C526297153E1007E16E-8938071"}',
'orderId': '612F1135E2A7A514C4444C526297153E1007E16E-8938071',
'proposalId': 0,
'source': 0,
'txAsset': '',
'txType': 'orderCancel'},
'fee': '1000BNB',
'inputs': [ { 'address': 'bnb1vyh3zd0z57j3f3zyf3fx99c48cgq0ctwmhtjft', 'coins': []}],
'outputs': [],
'timestamp': '',
'txHash': 'BCD1E9DA0D58C9B08DAA0CEEF0CA3A01E62C62F0647B89E214453DB6A6B81E4D'},

However, if we look at https://dex.binance.org/api/v1/transactions-in-block/179998840, we see that for this tx:

"txFee": "0.00000000",
"data": "{\"orderData\":{\"symbol\":\"CAS-167_BNB\",\"orderId\":\"612F1135E2A7A514C4444C526297153E1007E16E-8938071\"}}",

Note the fee is zero, and data has different fields. So I wonder, why the tx fee is different here? https://api.binance.org/bc/api/v1/blocks/179998840/txs also says the fee is zero. Which data is correct?