Skip to content

Commit

Permalink
Try confirmed check to fetch last root hash
Browse files Browse the repository at this point in the history
  • Loading branch information
dvush committed Jun 12, 2020
1 parent 2deedf3 commit 58735bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ jobs:
- name: integration-simple-full-exit
run: ci-integration-simple-fullexit.sh

# TODO: why it does not work on CI?
# - name: data-restore
# run: zksync data-restore check-existing
- name: data-restore
run: zksync data-restore check-existing

- name: integration-testkit
run: zksync integration-testkit
Expand Down
2 changes: 1 addition & 1 deletion bin/data-restore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BLOCK_HASH_ERR="Error: Unable to load the latest block hash"

function fetch_root_hash {
# Select the latest verified block and find its hash
QUERY="WITH last_block (number) AS (SELECT max(block_number) FROM operations WHERE action_type = 'VERIFY')
QUERY="WITH last_block (number) AS (SELECT max(block_number) FROM operations WHERE action_type = 'VERIFY' and confirmed = true)
SELECT encode(root_hash, 'hex') FROM blocks, last_block WHERE blocks.number = last_block.number;"
# By piping we make `psql` simply return value instead of drawing the table.
# `xargs` is used to trim spaces around the value.
Expand Down

0 comments on commit 58735bc

Please sign in to comment.