Table mem_accounts should be maintained same way as on master branch.
There are some differences, for example:
After genesis block insertion:
u_username is set to NULL istead of delegate nameu_isDelegate is set to 0 instead of 1producedblocks is not updated for delegate that forged that blockThese are only brief observations, there can be more.
Run app, wait for genesis block insertion, wait for some blocks, check mem_accounts
1.0.0
Issue with u_username and u_isDelegate is fixed with 0.9.12, thanks @nazarhussain for your research on it. 馃憤
Verified the behavior. The root cause of the problem is in applying confirmed state of delegate type transaction;
https://github.com/LiskHQ/lisk/blob/b4f91e0312d71a7b39e7ac0d4214cdba81d33ec0/logic/delegate.js#L278-L286
This issue is fixed in 0.9.12 with the commit https://github.com/LiskHQ/lisk/commit/1d8e9c3980ed1a686fd2d31e7a6ccb4ba86b67e4
Thanks @nazarhussain @4miners
Wait @karmacoma , there is still issue with producedblocks.
The problem with produced blocks the inconsistency of the attribute name case in code and in model definition.
https://github.com/LiskHQ/lisk/blob/b4f91e0312d71a7b39e7ac0d4214cdba81d33ec0/logic/round.js#L99
https://github.com/LiskHQ/lisk/blob/b4f91e0312d71a7b39e7ac0d4214cdba81d33ec0/logic/account.js#L805
Since we are incrementing these attributes with a static sql, which don't convert the name cases. If we do general update for account that handles the case conversion. Same applies to missed blocks as well.
Better approach to fix it permanently is to write a migration to change column names as what is specified mostly around the code. Also catch and throw the error here.
https://github.com/LiskHQ/lisk/blob/b4f91e0312d71a7b39e7ac0d4214cdba81d33ec0/logic/account.js#L482-L484
@MaciejBaj Probably we should add this test scenario in integration tests. To check if the delegate who had forged the block, should have increment producedBlocks count.
@nazarhussain Test for that will come with https://github.com/LiskHQ/lisk/issues/1303, already have them.
Most helpful comment
Verified the behavior. The root cause of the problem is in applying confirmed state of
delegatetype transaction;https://github.com/LiskHQ/lisk/blob/b4f91e0312d71a7b39e7ac0d4214cdba81d33ec0/logic/delegate.js#L278-L286
This issue is fixed in
0.9.12with the commit https://github.com/LiskHQ/lisk/commit/1d8e9c3980ed1a686fd2d31e7a6ccb4ba86b67e4