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

fix: Recovery of anchors from anchor origin #1046

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

bstasyszyn
Copy link
Contributor

@bstasyszyn bstasyszyn commented Jan 26, 2022

This commit adds the capability for an anchor origin to recover AnchorEvents and Sidetree files that it had previously published but does not currently have in its database (possibly due to a backup/restore). Logic has been added in the anchor sync process to also process the inboxes of services that are following me. So, an AnchorEvent may be recovered by reading the inbox of a service to which I had previously published a 'Create' activity. All of the Sidetree files are also recovered by supplying an 'alternate source' to the Observer. (The alternate source is the service from which I recovered the 'Create' activity.)

Also upgraded the Go version to 1.17 to all Docker images/builds and updated the Alpine version to 3.15. (This fixes a bug in Go version 1.17.3 where closing an HTTP response body always resulted in an error 'context canceled'. See golang/net@f0573a1.)

closes #1030

Signed-off-by: Bob Stasyszyn Bob.Stasyszyn@securekey.com

@cla-bot cla-bot bot added the cla-signed label Jan 26, 2022
@codecov
Copy link

codecov bot commented Jan 26, 2022

Codecov Report

Merging #1046 (67014e7) into main (a86ff56) will increase coverage by 0.02%.
The diff coverage is 93.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1046      +/-   ##
==========================================
+ Coverage   89.24%   89.26%   +0.02%     
==========================================
  Files         160      160              
  Lines       15503    15537      +34     
==========================================
+ Hits        13835    13869      +34     
  Misses       1023     1023              
  Partials      645      645              
Impacted Files Coverage Δ
pkg/store/anchoreventstatus/store.go 96.44% <ø> (-0.03%) ⬇️
...ctivitypub/service/activityhandler/inboxhandler.go 84.21% <90.00%> (ø)
...tivitypub/service/anchorsynctask/anchorsynctask.go 85.09% <90.90%> (-0.53%) ⬇️
...tivitypub/service/activityhandler/outboxhandler.go 79.36% <100.00%> (ø)
...kg/activitypub/service/anchorsynctask/syncstore.go 100.00% <100.00%> (ø)
pkg/activitypub/service/inbox/inbox.go 90.59% <100.00%> (ø)
pkg/activitypub/service/outbox/outbox.go 89.24% <100.00%> (ø)
pkg/anchor/handler/credential/handler.go 84.51% <100.00%> (+0.41%) ⬆️
pkg/observer/observer.go 82.29% <100.00%> (+0.08%) ⬆️
...g/protocolversion/versions/v1_0/factory/factory.go 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a86ff56...67014e7. Read the comment docs.

This commit adds the capability for an anchor origin to recover AnchorEvents and Sidetree files that it had previously published but does not currently have in its database (possibly due to a backup/restore). Logic has been added in the anchor sync process to also process the inboxes of services that are following me. So, an AnchorEvent may be recovered by reading the inbox of a service to which I had previously published a 'Create' activity. All of the Sidetree files are also recovered by supplying an 'alternate source' to the Observer. (The alternate source is the service from which I recovered the 'Create' activity.)

Also upgraded the Go version to 1.17 to all Docker images/builds and updated the Alpine version to 3.15. (This fixes a bug in Go version 1.17.3 where closing an HTTP response body always resulted in an error 'context closed'. See golang/net@f0573a1.)

closes trustbloc#1030

Signed-off-by: Bob Stasyszyn <Bob.Stasyszyn@securekey.com>
@bstasyszyn bstasyszyn merged commit 776730a into trustbloc:main Jan 26, 2022
@bstasyszyn bstasyszyn deleted the syncanchororigin2 branch January 26, 2022 19:17
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.

Recovery of anchors/DIDs on anchor origin
3 participants