Closed malik672 closed 1 month ago
I fail to see how a map is more performant than an if statement. It's also fine that it's an if statement, since the forks are inherently sequential, so we don't gain much in terms of code organization. In fact, this would require us to add forks in multiple places. Your proposed interface would also require us to first do a linear search in a vec, and then do a binary search in a map to do the fork -> specid mapping
Thank you for your suggestion:)
The
revm_spec
function currently uses a long chain of if-else statements to determine the appropriate SpecId based on the active fork. I think the forks should be separated into a new file and should be refactored to use mappings instead of the multiple if/esle statementssomething like this: