Closed marc0olo closed 6 months ago
currently it awaits an extra block as otherwise there are some issues where state is not available immediately after rollback
It will need some additional debugging to know where exactly the need for this workaround is originating
ahhh, now I remember we already had some discussion about that 😅
I get a consistent behavior (fresh node start + already started node at a later height) in my tests when executing the following code sequence in my tests:
// rollback to first keyblock
await utils.rollbackHeight(aeSdk, 0);
// stupid but strange, opened an issue here: https://github.com/aeternity/aeproject/issues/493
assert.equal(await aeSdk.getHeight(), 2);
// activate iris
await utils.awaitKeyBlocks(aeSdk, 3);
assert.equal(await aeSdk.getHeight(), 5);
let nodeInfo = await aeSdk.getNodeInfo();
assert.equal(nodeInfo.consensusProtocolVersion, 5);
it seems like the node is setting keyblock = 1 when performing the rollback to height 0, given that rollbackHeight
in aeproject executes following logic:
export const rollbackHeight = async (aeSdk, height) => {
const currentBlockHeight = await aeSdk.getHeight();
if (currentBlockHeight > height) {
await get(`http://localhost:3001/rollback?height=${height}`);
await awaitKeyBlocks(aeSdk, 1);
}
};
this still seems to happen, experienced it again, also @hanssv did, using await awaitKeyBlocks(aeSdk, 1);
after creating the snapshot seems to help, will investigate as I think the issue is in the underlaying devmode
Describe the bug Following testcode:
Fails with:
Expected behavior I expect the assertion to pass, currently it fails.
Please tell us about your environment:
v4.8.2
v0.5.2