I started this in https://github.com/ordinals/ord/pull/3778 but gave up because of all the test refactoring.