ethpm / ethpm-spec

Ethereum Package Manager http://ethpm.github.io/ethpm-spec/
165 stars 30 forks source link

Better define link references #96

Closed gnidan closed 6 years ago

gnidan commented 6 years ago

Update of #70

Fixes https://github.com/ethpm/ethpm-spec/issues/69

What was wrong

In the v1 version of the spec, link references were only defined as the locations within a block of bytecode in which an __Thing____ placeholder was found. This is problematic because:

  1. It is imprecise, requiring regex based detection.
  2. There are edge cases which cannot be handled once you start dealing with link values of varying lengths.

How was it fixed

Now, there is a Bytecode object which defines three fields.

Link references are further defined in a Link Reference object which contains three fields:

All bytecode and runtime_bytecode fields have been replaced to use the Bytecode object definition instead.

ℹ️ View preview

gnidan commented 6 years ago

@pipermerriam @mkosowsk please see recent commits and let me know if you have any other thoughts. Thanks!

mkosowsk commented 6 years ago

@gnidan most recent commits pass smell test for me altho I don't have cycles to read for depth at the moment. LGTM 👍🏻

gnidan commented 6 years ago

Merging. Thanks for the feedback!