Skip to content

Conversation

@montyly
Copy link
Contributor

@montyly montyly commented May 16, 2023

Build on top of #432 + merge dev + fix pylint

One thing I am unsure is if crytic_compile.filenames should return a list or a set. This is a merge of all the filenames from the different compilation units, so it can contain duplicate. Solutions:

  • Return a Set
  • Return a List where the duplicate are removed
  • Return a List with duplicate

The set remove the order, however the order makes sense only at the compilation unit level, and not the CryticCompile level I think.

What do you all think?

@montyly
Copy link
Contributor Author

montyly commented May 16, 2023

(cc @samalws-tob for visibility)

@samalws-tob
Copy link
Contributor

The reasons we need CompilationUnit.filenames to be ordered are:

  • So that sourcemap numbers match file filenames indices
  • So that the output is deterministic

Both of these apply to CryticCompile as well, so I think CryticCompile.filenames should be a list.

It seems like, in any case involving echidna, only one CompilationUnit per CryticCompile will be used. So I would say don't worry about the ordering of filenames in the case of multiple compilation units; feel free to remove duplicates or move things around or anything like that. All that matters is that in single-compilation-unit builds, CryticCompile.filenames is ordered in the same way as CompilationUnit.filenames.

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.

3 participants