We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi! Trying to update sqlx to 0.4.1 somehow breaks the interaction with decimals. The relevant code is here https://github.com/matter-labs/zksync/blob/master/core/lib/storage/src/chain/state/mod.rs#L172 This function basically collects updates and applies them, the problem comes with balances updating, please, take a look at the logs (I queried balances table before the insert and after)
sqlx
0.4.1
balances
[2020-12-09T20:37:27Z DEBUG zksync_storage::chain::state] Balances before apply_state_update: [] [2020-12-09T20:37:27Z DEBUG zksync_storage::chain::state] Sorted account update list: [ BalanceUpdate(StorageAccountUpdate { balance_update_id: 1, account_id: 1, block_number: 1, coin_id: 0, old_balance: BigDecimal("0"), new_balance: BigDecimal("2000000000000000000000"), old_nonce: 0, new_nonce: 0, update_order_id: 1 }), BalanceUpdate(StorageAccountUpdate { balance_update_id: 2, account_id: 1, block_number: 1, coin_id: 0, old_balance: BigDecimal("2000000000000000000000"), new_balance: BigDecimal("1999999968700000000000"), old_nonce: 1, new_nonce: 1, update_order_id: 3 }), BalanceUpdate(StorageAccountUpdate { balance_update_id: 3, account_id: 1, block_number: 1, coin_id: 0, old_balance: BigDecimal("1999999968700000000000"), new_balance: BigDecimal("1989999937400000000000"), old_nonce: 1, new_nonce: 2, update_order_id: 5 }), BalanceUpdate(StorageAccountUpdate { balance_update_id: 4, account_id: 2, block_number: 1, coin_id: 0, old_balance: BigDecimal("0"), new_balance: BigDecimal("10000000000000000000"), old_nonce: 0, new_nonce: 0, update_order_id: 6 }), BalanceUpdate(StorageAccountUpdate { balance_update_id: 5, account_id: 0, block_number: 1, coin_id: 0, old_balance: BigDecimal("0"), new_balance: BigDecimal("31300000000000"), old_nonce: 0, new_nonce: 0, update_order_id: 7 }), BalanceUpdate(StorageAccountUpdate { balance_update_id: 6, account_id: 0, block_number: 1, coin_id: 0, old_balance: BigDecimal("31300000000000"), new_balance: BigDecimal("62600000000000"), old_nonce: 0, new_nonce: 0, update_order_id: 8 })] [2020-12-09T20:37:27Z DEBUG zksync_storage::chain::state] Balances after apply_state_update: [ StorageBalance { account_id: 1, coin_id: 0, balance: BigDecimal("19899999374000") }, StorageBalance { account_id: 2, coin_id: 0, balance: BigDecimal("1000") }, StorageBalance { account_id: 0, coin_id: 0, balance: BigDecimal("626000") }]
You can clearly tell that the values got corrupted. Thanks to @mehcode I found the commit causing this mess a0007b4
UPDATE: I'm sorry, the bug was present, but the PR introduced new one, still trying to figure things out.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi!
Trying to update
sqlx
to0.4.1
somehow breaks the interaction with decimals. The relevant code is here https://github.com/matter-labs/zksync/blob/master/core/lib/storage/src/chain/state/mod.rs#L172This function basically collects updates and applies them, the problem comes with balances updating, please, take a look at the logs (I queried
balances
table before the insert and after)You can clearly tell that the values got corrupted. Thanks to @mehcode I found the commit causing this mess
a0007b4
UPDATE: I'm sorry, the bug was present, but the PR introduced new one, still trying to figure things out.
The text was updated successfully, but these errors were encountered: