Skip to content

Conversation

@honourfish
Copy link
Contributor

@honourfish honourfish commented Jan 29, 2025

Overview

  • add find-mmr-entries veracity IKWID command that finds matching mmr entries with mimum app entry data. for eventsv1 this is just trails + attributes.

Help Docs

NAME:
   veracity find-mmr-entries - finds the matching mmr entries for the given app entry.

                                   By default returns all mmr Indexes of matching mmr entries.

                                   The mmr entry is HASH(DOMAIN | MMR SALT | APP ENTRY)

                                   NOTE: ignores the global --tenant option, please use --log-tenant command option.


USAGE:
   veracity find-mmr-entries [command options] [arguments...]

OPTIONS:
   --log-tenant value      the tenant of the log to search in. Required
   --app-entry-file value  the file containing the app entry, if omitted uses stdin.
   --as-leafindexes        if true, returns a list of matching leaf indexes instead of mmr indexes. (default: false)
   --massif-start value    if set, start the search for matching trie entries at the massif at this given massif index. if omitted will start search at massif 0. (default: 0)
   --massif-end value      if set, end the search for matching trie entries at the massif at this given massif index. if omitted will end search at the last massif. (default: -1)
   --help, -h              show help

Testing

Manual testing done:

eventsv1.json:

{
    "attributes": {
        "4": "finally add in the eggs",
        "5": "put in the over until golden brown",
        "1": "pour flour and milk into bowl",
        "2": "mix together until gloopy",
        "3": "slowly add in the sugar while still mixing"
    },
    "trails": [
        "cake"
    ]
}
./veracity --loglevel INFO find-mmr-entries --log-tenant tenant/97e90a09-8c56-40df-a4de-42fde462ef6f < eventsv1.json

results in:

matches: [4 7]

re: AB#10156

@honourfish honourfish requested a review from eccles January 29, 2025 15:31
@honourfish honourfish merged commit 469cd00 into main Jan 30, 2025
3 checks passed
@honourfish honourfish deleted the dev/jgough/find-mmr-entry branch January 30, 2025 09:09
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.

3 participants