-
Notifications
You must be signed in to change notification settings - Fork 61
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
Loading of configuration values from a file while starting any network or sputnikvm #370
Comments
@harishbm34 do you want an arbiatry To figure out how we could approach that I need some info:
Also, how many fields are you expecting to store in such configurable storage?
|
@harishbm34 can it be passed through an initialization function, which will be called before first run? I doesn't change the fact that the contract should store it somewhere, but it would be better fit for the logic of contract. All components should expect that same code with same inputs (call input and current state) will always produce same output. Execution should be deterministic. So this configuration variable should be part of state, it should be clear that changing URL will affect results. |
If you precompiled contract makes external calls to that URL, I would also suggest to change the execution flow to more deterministic, which for that case would be 1) requesting an URL, as a method call 2) your external code immediately makes a request, and provides results as a separate call. That would be Oracles pattern, and all non-deterministic execution are clearly defined outside of smart contract execution, we can guarantee that for same data provided on step (2) you'll get same results of execution. |
@mersinvald : We are using SputnikVM as a library in our blockchain. @splix : That's very good question. Let me explain why we need to have configuration file within the initialise phase of loading SputnikVM and why we can't use another What we are looking is simply verifying a transaction inside the Ethereum blockchain. After verifying transaction we can claim GTX token in our blockchain automatically. To claim GTX token user needs to send 2 transactions. If we use another In the other hand, if each node can connect to the different node (or nodes) in Ethereum network, since the Ethereum transactions are immutable and deterministic, the result of the pre-compiled contract also would be deterministic as well. However some full nodes in our Galalctic blockchain might run the full node of Ethereum blockchain locally so they locally connect to the Ethereum blockchain. What we can suggest is adding a If you are agree about adding this new method to the patch trait we can handle it here. |
@mersinvald @splix : Shall we get an input for the above concern. |
Sorry, I missed your response. As we both see, there're few different ways to have such external calls, and one proposed by me is more complex. At this moment it's just something we'd like to have in future, but right now it will require a lot of work. If you think your way is deterministic for your use case, it's fine then, considering that it's an external implementation anyway so it doesn't conflict with possible other implementations, and it will be great to have it. If you can implement such initialization via config, we'll appreciate if you make a pull request, with changes related to SputnikVM side. I hope it's possible to make such configuration flexible and usable for other precompiled contracts |
We are implementing an "InterChainTransaction" precompiled contract to verify the transaction (tx1) which has happened on the "Ethereum Blockchain" during the ICO.
Once we are on the MAINNET, to verify the transaction (tx1), which was occurred on the Ethereum blockchain, we were hard-coding the "https://mainnet.infura.io/v3/{API-Key}" url inside the code. But we would like to keep these values somewhere in the configuration file, so that we can avoid the recompilation even though if we change the "URL" later.
Can we please have this feature in the "sputnikvm" so that it will help us a lot.
Kindly revert me in case if it requires more clarifications.
Regards,
Harish Belavadi
The text was updated successfully, but these errors were encountered: