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

feat: tel state noticer to query for tel updates #868

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iFergal
Copy link
Contributor

@iFergal iFergal commented Sep 24, 2024

Working towards TEL Observers - made some changes to make TSN behave same as KSN with a noticer that will fetch any remaining items.

This isn't fully complete as I need some feedback - I'm really not sure if we are meant to escrow notices of new events that we haven't received yet.

Looking back in the history, we did this for KSN too but changed it in #441 and #538 so thinking it might make sense for TSN to behave the same way so that we can have efficient TEL observers. So I've made some changes there to be more like KSN.

If this isn't the right approach, we need to do something to trigger fetching of tels - the telquery calls for escrows aren't right atm for the same reason as #865 - no src so messages are never sent.

if ri in self.tevers:
tever = self.tevers[ri]
tsn = tever.state()
self.cues.push(dict(kin="reply", route="/tsn/registry", data=asdict(tsn), dest=source))
self.cues.push(dict(kin="reply", route=f"/tsn/registry/{src}", data=asdict(tsn), dest=source.qb64))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if we should just skip this if vci is set below, depends on if we need to escrow or not

@@ -2007,12 +1994,8 @@ def processEscrows(self):
extype=kering.MissingRegistryError)
self.reger.txnsb.processEscrowState(typ="credential-mae", processReply=self.processReplyCredentialTxnState,
extype=kering.MissingAnchorError)
self.reger.txnsb.processEscrowState(typ="credential-ooo", processReply=self.processReplyCredentialTxnState,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this change is right, maybe we should also remove the credential-mre escrow, not sure.

sraw = self.reger.getTvt(key=dgKey(pre=regk, dig=ldig))
# assumes db ensures that sraw must not be none because sdig was in KE
sserder = serdering.SerderKERI(raw=bytes(sraw))
if ldig is not None: # escrow because event does not yet exist in database
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aligning with ksn

@m00sey m00sey marked this pull request as draft September 24, 2024 13:50
@m00sey m00sey added documentation Improvements or additions to documentation discussion needed and removed documentation Improvements or additions to documentation labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants