Giter Club home page Giter Club logo

Comments (5)

JakeOShannessy avatar JakeOShannessy commented on August 25, 2024

I've chosen this as the capability to implement next, as it doesn't involve any additional mechanisms except those required for write. By implementing this we can simply test how general the system is.

from cap9.

JakeOShannessy avatar JakeOShannessy commented on August 25, 2024

Each log item can have 0-4 topics. We can use these topics to form a hierarchy of sorts. A log capability can have the following formats:

  • 0: The procedure can write to any combination of 0-4 topics.
  • 1 [firstTopic]: The procedure must have at least one topic, and the first topic must be "firstTopic".
  • 2 [firstTopic. secondTopic]: The procedure must have at least two topics, the first topic must be "firstTopic". and the second topic must be "secondTopic"
  • 3: as above but with 3 topics
  • 4 [firstTopic, secondTopic, thirdTopic, fourthTopic]: Must have exactly 4 topics exactly as specified.

The format of the capability is currently that the first 32 bytes are the number of topics, and the next 0-4 32-byte values are the topics themselves. This means the capability can be 1, 2, 3, 4, or 5 32-byte values long.

0x0: number of topics, `nTopics` (32 bytes)
0x20: first topic
0x40: second topic
0x60: third topic
0x80: fourth topic

from cap9.

Latrasis avatar Latrasis commented on August 25, 2024

Sounds good.

I imagine we could make the topics smaller (8 bytes each), fit the cap in a single key (32 bytes) and simply use 0x0 as a "empty" marker. This would be more complicated though.

from cap9.

JakeOShannessy avatar JakeOShannessy commented on August 25, 2024

Yes, but then you are also dramatically limiting the use of topics, as topics on the EVM are 32-byte. Probably not worth the small packing gains.

Actually there are a few other instances where we could definitely reduce number sizes where we are currently just using 32-byte words, which I've done for simplicity.

from cap9.

JakeOShannessy avatar JakeOShannessy commented on August 25, 2024

This is currently implemented in #44.

from cap9.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.