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

Need schema-like compression to avoid storing and transmitting redundant data. #2112

Open
erights opened this issue Mar 3, 2024 · 0 comments · May be fixed by #1584
Open

Need schema-like compression to avoid storing and transmitting redundant data. #2112

erights opened this issue Mar 3, 2024 · 0 comments · May be fixed by #1584
Assignees
Labels
bug Something isn't working

Comments

@erights
Copy link
Contributor

erights commented Mar 3, 2024

Describe the bug

We are spending way too much storage space on redundant boilerplate data with is redundant with, and implied by, the patterns that the data must match. This bug records the need for compression/decompression support, as would be closed by #1584 . Separate bugs like Agoric/agoric-sdk#3167 record the need to actually use such compression to reduce storage or transmission, as would be aided by Agoric/agoric-sdk#6432

(From Agoric/agoric-sdk#6432 (comment) ):

For example without compression, the Zoe proposal

    {
      want: {
        Winnings: {
          brand: moolaBrand,
          value: makeCopyBagFromElements([
            { foo: 'a' },
            { foo: 'b' },
            { foo: 'c' },
          ]),
        },
      },
      give: { Bid: { brand, value: 37n } },
      exit: { afterDeadline: { deadline: 11n, timer } },
    },

is stored with a smallcaps body of

'#{"exit":{"afterDeadline":{"deadline":"+11","timer":"$0.Alleged: timer"}},"give":{"Bid":{"brand":"$1.Alleged: simoleans","value":"+37"}},"want":{"Winnings":{"brand":"$2.Alleged: moola","value":{"#tag":"copyBag","payload":[[{"foo":"c"},"+1"],[{"foo":"b"},"+1"],[{"foo":"a"},"+1"]]}}}}'

But it compresses with the proposalShape

    harden({
      want: {
        Winnings: {
          brand: moolaBrand,
          value: M.bagOf(harden({ foo: M.string() }), 1n),
        },
      },
      give: { Bid: { brand, value: M.nat() } },
      exit: { afterDeadline: { deadline: M.gte(10n), timer } },
    })

to

[[['c'], ['b'], ['a']], 37n, 11n]

whose smallcaps body is

'#[[["c"],["b"],["a"]],"+37","+11"]'

which is 12% as long.

@erights erights added the bug Something isn't working label Mar 3, 2024
@erights erights self-assigned this Mar 3, 2024
@erights erights linked a pull request Mar 3, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant