Skip to content

Restore pending key rotations on re-syncs #45

@corrideat

Description

@corrideat

Problem

From #33 (comment)

There still is one race condition that needs to be handled. The situation is more or less as follows:

Setup:

A contract with a foreign key that's out of sync (but that has been rotated at least once) and syncing from scratch.

Race condition:

  1. Chelonia notices that the key needs to be rotated as pendingKeyRotations is set
  2. Chelonia notices that the key has been updated and clears pendingKeyRotations. This step may be wrong if the key still is out of sync (it could have been updated, just not to the latest).

Solution

pendingKeyRotations should not be cleared if the key still is out of sync. Alternatively, pendingKeyRotations can be cleared, but it must be set again.

(pendingKeyRotations is a dictionary; set and clear truly mean the corresponding key in the dictionary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions