Skip to content

Expose sub-structure of bytecode #9332

Open
@chriseth

Description

@chriseth

@alcuadrado and others proposed to expose the boundary between code and data in the emitted bytecode ( https://www.notion.so/Miscellaneous-debugging-symbols-Initial-proposal-2948f1a1f74742c0901ad54af05fa1ff ). I think this is a good idea, but we should not stop at only that number.

In essence, we have code, sub-objects (runtime code of the current contract or creation code of created contracts), data and metadata. This structure also matches what we have when we compile Yul objects, so I think a common data format can be found here.

Proposal:

Export an array of sections, each section is a json object of the following form:

{
  start: x, // bytes
  length: n, // bytes
  kind: 'code' / 'data' / 'object' / 'deployObject' / 'metadata',
  name: 'factory.sol:Factory'
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    high impactChanges are very prominent and affect users or the project in a major way.low effortThere is not much implementation work to be done. The task is very easy or tiny.must have eventuallySomething we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.needs designThe proposal is too vague to be implemented right awayprotocol design 🔮Potential changes to ABI, meta data, standard JSON

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions