Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update logic related to verifyLivenessConditionForRegisteredChains #7686

Closed
Tracked by #7211
ishantiw opened this issue Oct 24, 2022 · 0 comments · Fixed by #7771
Closed
Tracked by #7211

Update logic related to verifyLivenessConditionForRegisteredChains #7686

ishantiw opened this issue Oct 24, 2022 · 0 comments · Fixed by #7771
Assignees
Labels
framework/module/interoperability Interoperability module
Milestone

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Oct 24, 2022

Description

Improve util functions based on the latest update in LIP0053

def verifyLivenessConditionForRegisteredChains(ccu: Transaction) -> None:
    if len(ccu.params.certificate) > 0 and len(ccu.params.inboxUpdate) > 0:
        certificate = decode(certificateSchema, ccu.params.certificate)
        timestamp = timestamp of the block including ccu
        if len(ccu.params.inboxUpdate) > 0 and timestamp - certificate.timestamp > LIVENESS_LIMIT / 2:
            raise Exception(f"The first CCU with a non-empty inbox update cannot contain a certificate older than {LIVENESS_LIMIT / 2} seconds.")

Acceptance Criteria

  • Should have unit test

Additional Information

@ishantiw ishantiw added the framework/module/interoperability Interoperability module label Oct 24, 2022
@shuse2 shuse2 self-assigned this Nov 10, 2022
@shuse2 shuse2 added this to the Sprint 82 milestone Nov 10, 2022
@shuse2 shuse2 linked a pull request Nov 15, 2022 that will close this issue
shuse2 added a commit that referenced this issue Nov 15, 2022
### What was the problem?

This PR resolves #7686 

### How was it solved?

- Add `verifyLivenessConditionForRegisteredChains` in utils for
interoperability according to LIP

### How was it tested?

- Add unit tests
@shuse2 shuse2 closed this as completed Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework/module/interoperability Interoperability module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants