spec icon indicating copy to clipboard operation
spec copied to clipboard

ABI version and enumeration constants

Open esnible opened this issue 3 years ago • 4 comments

I noticed a recent change added an enumeration to the FilterHeadersStatus return codes for ContinueAndDontEndStream. https://github.com/envoyproxy/envoy/blob/master/include/envoy/http/filter.h#L75

Envoy WASM doesn't yet have the change [ https://github.com/envoyproxy/envoy-wasm/blob/master/include/envoy/http/filter.h ]

The AssemblyScript runtime has its own version of the enumeration, at https://github.com/solo-io/proxy-runtime/blob/master/assembly/runtime.ts#L96 , which doesn't include the new enumeration. The current AssemblyScript runtime advertises itself as proxy_abi_version_0_2_0.

How will this work in practice when Envoy WASM picks up the new enumeration from Envoy? Do we expect

  • Envoy-Wasm will pick up the Envoy change but re-order the enumeration so binary enum constant values don't change?
  • Envoy-Wasm will reject plugins with ABI older version point release, forcing filter developers to recompile?
  • Envoy-Wasm will including enumeration mapping, and proxy_abi_version_0_2_0 filters can continue to return 4 for FilterHeadersStatus.StopAllIterationAndBuffer alongside proxy_abi_version_0_2_x filters returning 5 for proxy_abi_version_0_2_0?

esnible avatar Sep 15 '20 11:09 esnible

@PiotrSikora this seems really bad that enums are remapped and can crash proxy.

mandarjog avatar Sep 24 '20 17:09 mandarjog

@soya3129 Can you comment on why the enums were remapped in https://github.com/envoyproxy/envoy/pull/7756/files instead of adding a new enum at the end?

mandarjog avatar Sep 24 '20 17:09 mandarjog

How will this work in practice when Envoy WASM picks up the new enumeration from Envoy? Do we expect

  • Envoy-Wasm will pick up the Envoy change but re-order the enumeration so binary enum constant values don't change?

Proxy-Wasm ABI is independent of Envoy, the values are mapped and not passed-through, so the renumeration in Envoy doesn't matter at all (unless there are some bugs or leftovers in Envoy-Wasm).

  • Envoy-Wasm will reject plugins with ABI older version point release, forcing filter developers to recompile?

Envoy supports multiple versions of the ABI at the same time, it currently supports 0.1.0, 0.2.0 and 0.2.1.

  • Envoy-Wasm will including enumeration mapping, and proxy_abi_version_0_2_0 filters can continue to return 4 for FilterHeadersStatus.StopAllIterationAndBuffer alongside proxy_abi_version_0_2_x filters returning 5 for proxy_abi_version_0_2_0?

Filters should return values defined in the ABI, not enum values from Envoy.

PiotrSikora avatar Sep 25 '20 21:09 PiotrSikora

Filters should return values defined in the ABI, not enum values from Envoy.

Can you point me to the authoritative ABI return values list?

esnible avatar Sep 28 '20 13:09 esnible

I believe this will be resolved by our project overhaul. Please refer to https://github.com/proxy-wasm/spec/pull/39#issuecomment-1577876577 for the context. Thanks!

mathetake avatar Jun 06 '23 04:06 mathetake