Skip to content

Implement API endpoint to download UTB#10

Merged
b3y0urs3lf merged 2 commits intomainfrom
get-utb
Jan 20, 2026
Merged

Implement API endpoint to download UTB#10
b3y0urs3lf merged 2 commits intomainfrom
get-utb

Conversation

@lploom
Copy link
Contributor

@lploom lploom commented Jan 15, 2026

No description provided.

@lploom lploom requested a review from MastaP January 15, 2026 15:07
@lploom lploom linked an issue Jan 15, 2026 that may be closed by this pull request

// LoadLast returns trust base for the latest epoch.
func (s *TrustBaseStore) LoadLast() (*types.RootTrustBaseV1, error) {
dbIt := s.db.Last()
Copy link
Member

Choose a reason for hiding this comment

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

does this guarantee that the epoch with the largest value is returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes?

Copy link
Member

Choose a reason for hiding this comment

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

ok. I simply don't remember if it returns last added element (which might for some reason not be the latest epoch) or the largest element

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it returns the largest key, which should be the largest epoch, at least for now

Copy link

@ahtotruu ahtotruu Jan 19, 2026

Choose a reason for hiding this comment

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

ok. I simply don't remember if it returns last added element (which might for some reason not be the latest epoch) or the largest element

It shouldn't really be possible to add trust base records out-of-order, because they need to be verified and the verification is via hash backlink to the previous record and signatures of the validators of the previous epoch (both of which you know from the previous trust base record).

@MastaP
Copy link
Member

MastaP commented Jan 16, 2026

pls create a follow-up task to add Auth to PUT endpoint

@b3y0urs3lf b3y0urs3lf merged commit 8a4f7aa into main Jan 20, 2026
3 checks passed
@MastaP MastaP deleted the get-utb branch February 25, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement API endpoint to download UTB

4 participants