Skip to content

refactor(db): Migrate wigs database to CesrIoSetSuber#1180

Merged
SmithSamuelM merged 14 commits intoWebOfTrust:mainfrom
alecforston:wigs1
Feb 23, 2026
Merged

refactor(db): Migrate wigs database to CesrIoSetSuber#1180
SmithSamuelM merged 14 commits intoWebOfTrust:mainfrom
alecforston:wigs1

Conversation

@alecforston
Copy link
Copy Markdown
Contributor

For issue #1163

Summary

Refactored wigs database from raw LMDB storage to CesrIoSetSuber, enabling type-safe storage of Siger objects instead of raw bytes.

Changes

Schema Update

# Before
self.wigs = self.env.open_db(key=b'wigs.', dupsort=True)

# After  
self.wigs = subing.CesrIoSetSuber(db=self, subkey='wigs.', klas=indexing.Siger)

Removed Helper Methods

Deleted deprecated Baser methods that are replaced by CesrIoSetSuber API:

  • getWigs()wigs.get()
  • getWigsIter()wigs.getIter()
  • putWigs()wigs.pin()
  • addWig()wigs.add()
  • cntWigs()wigs.cnt()
  • delWigs()wigs.rem()

Updated Call Sites

Migrated ~40+ usages across the codebase:

Files modified:

  • src/keri/db/basing.py - Database schema and helper methods
  • src/keri/core/eventing.py - Event processing and witness signature handling
  • src/keri/app/agenting.py, delegating.py, grouping.py, indirecting.py - Application layer
  • src/keri/app/cli/ - CLI commands
  • src/keri/vdr/credentialing.py - Credential verification
  • tests/ - Test updates for new API

Testing

  • Updated test_basing.py to create valid Siger objects using signing keys
  • All existing tests pass with new implementation

Copy link
Copy Markdown
Collaborator

@SmithSamuelM SmithSamuelM left a comment

Choose a reason for hiding this comment

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

Looks good

@SmithSamuelM
Copy link
Copy Markdown
Collaborator

Not sure why your pull request is worried about a workflow pull request

@SmithSamuelM
Copy link
Copy Markdown
Collaborator

Please resolve conflicts

Copy link
Copy Markdown
Collaborator

@SmithSamuelM SmithSamuelM left a comment

Choose a reason for hiding this comment

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

the new CeserSuber returns instances of siger not qb64 signature, therefore the convention for the return variable is to use the variable wiger for (witness siger) and not wits. So everywhere that the old code is returns to wits it should be wigers.

@SmithSamuelM SmithSamuelM merged commit 5f31036 into WebOfTrust:main Feb 23, 2026
7 checks passed
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.

2 participants