Git Product home page Git Product logo

Comments (3)

sept-en avatar sept-en commented on August 12, 2024 1

@birchmd this is a good suggestion! The thing worth noticing here is that new() for the engine allows setting the state for it multiple times, however, eth-connector allows doing the initialization only once. This is because obviously, we don't want to accidentally overwrite the FungibleToken data. For the sake of updating the contract addresses in eth-connector, I added some time ago set_eth_connector_contract_data() method which sets the provided prover ID and EthCustodian address.
So I think the correct behavior for eth-connector in new() will be the following:

  • If eth-connector is not initialized -> call init_contract() method;
  • If eth-connector is initialized -> call set_contract_data() method.

For sure, we can modify the behavior of init_contract allowing it to be called multiple times without modifying FungibleToken and paused_mask if the contract is initialized, but I think this will be a little bit misleading, so I'd prefer having the check on the engine level in new() method.

For the prover ID in the engine state, I remember I reported about it some time ago and I even remember that I removed it. Not sure why we still have it there, but this is quite minor so we can just proceed with removing it again.

from aurora-engine.

mrLSD avatar mrLSD commented on August 12, 2024

@birchmd What practical case for mainnet use multiple times new function?
Also as mentioned @sept-en FunginlrToken should be inited only once.

I think we can add additional parameters for new function for eth-connector part. And again check for only one eth-connector init call.

from aurora-engine.

birchmd avatar birchmd commented on August 12, 2024

What practical case for mainnet use multiple times new function?

I don't think this is an important consideration. We want to be able to deploy the contract more places than just mainnet. For example, community members may wish to deploy it on a local node for testing purposes. And getting an error because they only called new without new_eth_connector is a bad developer experience. If they use the aurora CLI then this complexity is hidden because there is a single init call there. But I think the point remains that it is unintuitive to have two required calls when it would be easy enough for us to only have one.

from aurora-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.