Skip to content
  • Sergey Pepyakin's avatar
    Embed runtime version as a custom section (#8688) · 0849bcce
    Sergey Pepyakin authored
    
    
    * emit a custom section from impl_runtime_apis!
    
    This change emits a custom section from the impl_runtime_apis! proc macro.
    
    Each implemented API will result to emitting a link section `runtime_apis`.
    During linking all sections with this name will be concatenated and
    placed into the final wasm binary under the same name.
    
    * Introduce `runtime_version` proc macro
    
    This macro takes an existing `RuntimeVersion` const declaration, parses
    it and emits the version information in form of a linking section.
    Ultimately such a linking section will result into a custom wasm
    section.
    
    * Parse custom wasm section for runtime version
    
    * Apply suggestions from code review
    
    Co-authored-by: default avatarDavid <[email protected]>
    
    * Fix sc-executor integration tests
    
    * Nits
    
    Co-authored-by: default avatarBastian Köcher <[email protected]>
    
    * Refactor apis section deserialization
    
    * Fix version decoding
    
    * Reuse uncompressed value for CallInWasm
    
    * Log on decompression error
    
    * Simplify if
    
    * Reexport proc-macro from sp_version
    
    * Merge ReadRuntimeVersionExt
    
    * Export `read_embedded_version`
    
    * Fix test
    
    * Simplify searching for custom section
    
    Co-authored-by: default avatarDavid <[email protected]>
    Co-authored-by: default avatarBastian Köcher <[email protected]>
    0849bcce