Skip to content

Conversation

@dunhor
Copy link
Member

@dunhor dunhor commented Apr 8, 2022

Currently interfaces are being sorted for fast ABI by their current contract version which is incorrect because (1) we actually want to consider their initial contract/version, not the current ones, and (2) we want to consider the contract each interface was introduced in relative to the contract history of the type they apply to. E.g. an interface introduced in contract 'A' version 2 should be sorted before an interface introduced in contract 'B' version 1 if the class was in contract 'A' before contract 'B'.

Note that the sorting algorithm is N^2, however this should be fine since moving contracts should be rare and the history should be small to the point that trying to create a graph/linked list would be wasteful and probably more inefficient.

Also note that this maintains some simplifying assumptions we've generally agreed in the past are okay.

  • It ignores the "versioning scheme" of the attribute and instead assumes that if contracts are involved at all, everything is contract versioned
  • It assumes that relevant interfaces are introduced and added to the type in the same contract/version. I.e. it ignores the versioning attributes on the class's interface impl list

@kennykerr kennykerr merged commit c4a8e24 into master Apr 9, 2022
@kennykerr kennykerr deleted the user/dunhor/fastabi_from_contract branch April 9, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants