Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

[Web3] Configurability #1279

Open
gregdhill opened this issue Sep 30, 2019 · 7 comments
Open

[Web3] Configurability #1279

gregdhill opened this issue Sep 30, 2019 · 7 comments
Labels
area/gateway type/good starter issue this issue is limited in scope otherwise suitable for new contributors

Comments

@gregdhill
Copy link
Contributor

In order to preserve the outer dynamics of the web3 interface we have to change the representation of token values, state hashes and keys. It would be nice if these adjustments where configurable, with sensitive defaults.

@gregdhill gregdhill added area/gateway type/good starter issue this issue is limited in scope otherwise suitable for new contributors labels Sep 30, 2019
@rohitkumarWUSTL
Copy link

rohitkumarWUSTL commented Sep 30, 2019

I'm a first-time open source contributor (though I've got a small amount of gRPC/protobuf experience, for what it's worth) - I'd be interested in picking up this issue, if it's a good starter one, although to be honest wrapping my head around the repo seems like a bit of a tall order so it might take me some time to get there.

(I also completely understand if this would be better-suited for someone with more experience w/ Burrow to pick up!)

@gregdhill
Copy link
Contributor Author

Hey @rohitkumarWUSTL! Thanks for the interest, I can post a few links which I think may be of help. So when we establish the web3 service here, we should pass in a new config (which can be added here. The service can then check this config before doing things such as the balance conversion here.

@rohitkumarWUSTL
Copy link

Thanks! The links are helpful. Sorry, I just need a little clarification - does the BurrowConfig contain sufficient information already (i.e. the only change that needs to be made is for the config field in the EthService struct to change types from a tmConfig to a BurrowConfig), or do additional fields need to be added to the BurrowConfig struct to reflect configurations of token values, state hashes and keys (with corresponding additions in the DefaultBurrowConfig() function as well)?

(Or are neither of those the case, and I completely misread what you're going for?)

@gregdhill
Copy link
Contributor Author

So currently we only pass tmConfig as you've discovered, but we can pass the full BurrowConfig instead since it contains the Tendermint configuration. For this task we'll want to add another set of options to BurrowConfig in a sub-struct - one field of which may be the conversion rate for instance.

@rohitkumarWUSTL
Copy link

rohitkumarWUSTL commented Oct 4, 2019

I see, that makes sense. So the changes that need to be made are:

  • Change the tmConfig field in the EthService struct to a BurrowConfig
  • Add a sub-struct to the BurrowConfig struct for additional configs (what should it be called?)
  • Implement defaults for this sub-struct (I'll need some guidance on this as I don't have any domain knowledge yet, sorry)
  • (Possibly) refactor anywhere where an EthService is constructed with a custom config object?

Am I missing anything? Thank you for being so helpful!

@gregdhill
Copy link
Contributor Author

Those changes sound good to me! We can name the sub-struct Web3, and start off with a conversion rate field that is either a customizable *big.Int or we can create an enum for ethereum denominations. Once that's done we can discuss other settings.

@deepakchethan
Copy link
Contributor

@rohitkumarWUSTL are you still working on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/gateway type/good starter issue this issue is limited in scope otherwise suitable for new contributors
Development

No branches or pull requests

3 participants