-
Notifications
You must be signed in to change notification settings - Fork 777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What to do about (un)common
params
gotchas
#3555
Comments
I think that's an imagined issue that won't bite us. I fixed dozens of these kind of cases in the first round, so this is literally "by design". This only happens "from the outside" (so e.g. in the test scenario mentioned) where one wants to request a parameter from outside a specific library. These cases are very much detectable just "on writing". So this would just directly throw (if one writes e.g. a new test case (rare!) in such a manner). So, the semantics of Common just have changed and this need a redefinition: Common itself is not providing the paramters any more, but just provides a container mechanism "to provide parameters in whatever way". It is up to the packages to make sure that parameters used within are provided along the initialization. |
(I also don't have any name issues, since this is still holding a common/shared configuration (chain/HF/crypto) throughout and across the libraries) |
Fair enough. @jochem-brouwer does this address your concerns? |
No follow-up will close for now, feel free to re-open |
Should have closed this myself, per the discussion we had regarding this issue 👍 😄 |
In the course of working on #3545, we encountered a scenario where code was trying to read from
common.params
and was getting an "undefined" type result where the desired param could not be found. This stems from looking in acommon
instance where those params weren't available (like this where a test is trying to read atx
-specific parameter that wasn't available in theevm
common
instance. This all happens now because of #3537.The basic issue is that before #3537, we could generally count on
common
parameters to be the same across all instance ofcommon
that existed in an application but that is no longer the case (with the goal of shrinking our bundle size) since each of our packages has it's own interior set of parameters that are specific to that package and won't be accessible from other packages now. Here again, not an issue per se but just requires us to change how we think aboutcommon
.One idea was to bring back in a
topic
concept that existed before #3537 but instead of having topics likegasConfig
, the topic is the package that the parameters come from. So, a call might look something like:And if this common didn't have the
tx
parameters, it would throw an error liketx params not initialized
or something to that effect.An alternative approach is to get rid of the entire naming
common
and replace it with something likeethjsConfig
or something since this package isn't really a set ofResources common to all EthereumJS implementations
(taken from thecommon
README), but more a "chain configuration" for each object instantiated for a specificethereumjs
class type.This is just for conversation at this point but we should consider if this is a real or imagined issue as we continue to get used to these API changes.
The text was updated successfully, but these errors were encountered: