Skip to content
New issue

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

Node crashes on quick restart after being killed #2838

Closed
ulope opened this issue Oct 18, 2018 · 4 comments · Fixed by #2884
Closed

Node crashes on quick restart after being killed #2838

ulope opened this issue Oct 18, 2018 · 4 comments · Fixed by #2884
Assignees

Comments

@ulope
Copy link
Collaborator

ulope commented Oct 18, 2018

Problem Definition

(This may be parity related, haven't tested with Geth yet.)

Steps to reproduce:

  • Kill a node (with SIGKILL, -9) right after a new block was received
  • Restart node within a few seconds

The node crashes with a ValueError from within web3:

ValueError: {'code': -32000, 'message': 'One of the blocks specified in filter (fromBlock, toBlock or blockHash) cannot be found', 'data': '0x8b2045'}

Full logs
As you can see the data attribute in the error is increasing and seems to be a block number.

  • 0x8b2045 -> 9.117.765
  • 0x8b2047 -> 9.117.767
  • 0x8b2048 -> 9.117.768

This error persists for a while but disappears after a few minutes.

@hackaugusto
Copy link
Contributor

Maybe this was fixed by #2671

@ulope
Copy link
Collaborator Author

ulope commented Oct 19, 2018

@hackaugusto Unfortunately not, this was with latest master as of yesterday evening (e0f3e6f) which already includes that PR.

@hackaugusto
Copy link
Contributor

Ahhh, I think I know what is the problem:

self._last_block + 1,

hackaugusto added a commit to hackaugusto/raiden that referenced this issue Oct 24, 2018
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
palango pushed a commit to hackaugusto/raiden that referenced this issue Oct 28, 2018
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
@LefterisJP
Copy link
Contributor

As discussed in Rocketchat this should no longer be happening after #2895 which now updates the block state only with confirmed blocks.

LefterisJP pushed a commit to LefterisJP/raiden that referenced this issue Nov 7, 2018
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
LefterisJP pushed a commit that referenced this issue Nov 8, 2018
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes #2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 18, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
hackaugusto added a commit to hackaugusto/raiden that referenced this issue Jan 25, 2019
The race happened under this circunstance:

- A node learns about a new block, updates its state, then crashes
- On restart, the block number is recovered, the filters are
  installed with the latest known block.
- The race: The node finishes the above before a new block is mined
- The bug: The filter is polled during start of the RaidenService, by
  calling the AlarmTask.first_run, which always executes the
  callbacks, eventually using the StateFilter's to poll for new events
  from a block in the future.

The fix was to give the latest known block number to the alarm task in
the as an argument for first_run, and only execute the callbacks if
there is a new block.

fixes raiden-network#2838
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants