October 2019 Conseil release – 2.5.1
This is a follow up release to the previous one so that Conseil is compatible with the Tezos proto5 and still remains backwards compatible with previous protocols.
A full resync is required.
The config file formats have changes so please see https://github.com/Cryptonomic/Conseil#the-configuration-entries for the new format.
A snapshot Conseil database dump from a Cryptonomic production envrionment is available at https://conseil-snapshots.s3.amazonaws.com/conseil_20191018_patched.zip.
Patch to fix account data issues discovered post release
After the release we became aware of an issue relating to account data. As part of the proto5 upgrade, several KT1 accounts were modified as described at https://medium.com/cryptium/meanwhile-at-cryptium-labs-1-part-vi-540170f46c51. Unfortunately, the code did not handle these updates so the Conseil database did not reflect changes to many KT1 contracts as they changed outside of the usual operations process.
If you are using a Cryptonomic database snapshot you do not need to follow these steps.
We are working on a strategic solution and will provide a new release in the upcoming days. Until then, we are providing a tactical fix involving manual modification of the database. This is very hacky and we regret the nature of the fix. We will be further enhancing our testing and release process for the next protocol upgrade.
Here are the steps for patching accounts data:
- Stop the Lorre process after ensuring some proto5 blocks have already been indexed.
- Query Conseil and get the level of the latest block. Let's call this level
$conseil_level
. - Wait at least two minutes.
- Query your Tezos node or Mininax to get the hash of the Tezos block at
$conseil_level+1
. Let's call these$tezos_level
and$tezos-hash
respectively. - Back up your database in case things go wrong.
- Execute the below SQL statements after replacing the template variables with their actual values.
- Restart Lorre and wait for five minutes.
- Make sure the Conseil head and Tezos head blocks now match.
- Pull up some delegated KT1 contracts and ensure their information looks correct by comparing the corresponding data from Mininax.
- You are good to go.
If you experience any issues, please do not hesitate to reach out to us on our developers channel at https://matrix.to/#/!rUwpbdwWhWgKINPyOD:cryptonomic.tech?via=cryptonomic.tech&via=matrix.org&via=tzchat.org.
Template SQL:
ALTER TABLE accounts_checkpoint DROP CONSTRAINT checkpoint_block_id_fkey;
INSERT INTO accounts_checkpoint
(SELECT DISTINCT account_id, '$TEZOS_HASH' as block_id, $TEZOS_LEVEL as block_level from accounts where account_id like 'KT1%'
UNION
SELECT DISTINCT delegate_value as account_id, '$TEZOS_HASH' as block_id, $TEZOS_LEVEL as block_level from accounts where delegate_value IS NOT NULL
);
Actual example:
ALTER TABLE accounts_checkpoint DROP CONSTRAINT checkpoint_block_id_fkey;
INSERT INTO accounts_checkpoint
(SELECT DISTINCT account_id, 'BL7VsHPkQUYv56KDSzvZJSufFrPhXN6ZBfQ6SLGbUrCsRRz7bTW' as block_id, 655362 as block_level from accounts where account_id like 'KT1%'
UNION
SELECT DISTINCT delegate_value as account_id, 'BL7VsHPkQUYv56KDSzvZJSufFrPhXN6ZBfQ6SLGbUrCsRRz7bTW' as block_id, 655362 as block_level from accounts where delegate_value IS NOT NULL
);