From 85309b8ac6aef589b166cc99926dd8308066740b Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Wed, 16 Nov 2022 12:55:06 -0800 Subject: [PATCH] Add meeting notes for interface inheritance meeting --- meetings/2022-11-16-Interface-Inheritance.md | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meetings/2022-11-16-Interface-Inheritance.md diff --git a/meetings/2022-11-16-Interface-Inheritance.md b/meetings/2022-11-16-Interface-Inheritance.md new file mode 100644 index 0000000000..8dc40689d4 --- /dev/null +++ b/meetings/2022-11-16-Interface-Inheritance.md @@ -0,0 +1,32 @@ +# Nov 16, 2022 + +## Interface Inheritance Meeting Notes + +* FLIP: https://github.com/onflow/flips/pull/40 + +* Forum discussion: https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750 + +* Open Questions: + * Functions with conditions: + * FLIP proposes to order them in a pre-determined order and run them all. + * No overriding is supported (because of security concerns). + * Is overriding needed? Potentially unsafe to do so. + + * Default functions: Two main concerns. + * Should allow overriding of default functions? + * Can be a security/safety concern. + * Someone in a middle of an inheritance chain can override a default function, which would change the behavior for downstream contracts. + * One solution is to make default functions to be 'view' only. + * Reduce the depth/impact of security concerns of overriding. + * Still going to need a way to resolve ambiguity. e.g: Two ‘getId()’ view functions are available; which of the two should be called? + * How to resolve ambiguity, when two or more default implementations are available for functions? + * Two potential solutions: + * Ask the user to solve it by overriding the method inside the concrete-type/interface which faces ambiguity + (This is what is proposed in the FLIP). + * Ambiguity resolution of default functions in concrete types also uses the same approach. + See: https://github.com/onflow/cadence/pull/1076#discussion_r675861413 + * Order/linearize the default functions and pick the one that is 'closest' to the current interface/concrete type. + * It is 'safe' only if the default functions are view only. + * Might be surprising to the user. + * Already disregarded this option for default functions ambiguity resolution in concrete implementations. + * Need to resolve ambiguity regardless of whether default function overriding is supported or not.