Skip to content
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

solidity compiler and contract metadocs integration #833

Merged
merged 1 commit into from
May 8, 2015

Conversation

zelig
Copy link
Contributor

@zelig zelig commented Apr 29, 2015

  • common/compiler: solidity compiler + tests
  • rpc: eth_compilers, eth_compileSolidity + tests
  • fix natspec test using keystore API, notice exp dynamically changes addr, cleanup
  • resolver implements registrars and needs to create reg contract (temp)
  • xeth: solidity compiler. expose getter Solc() and paths setter SetSolc(solcPath)
  • ethereumApi: implement compiler related RPC calls using XEth - json struct tests
  • admin: make use of XEth.SetSolc to allow runtime setting of compiler paths
  • cli: command line flags solc to set custom solc bin path
  • js admin api with new features debug and contractInfo modules
  • wiki is the doc https://github.com/ethereum/go-ethereum/wiki/Contracts-and-Transactions

@zelig zelig added this to the Frontier milestone Apr 29, 2015
@zelig zelig self-assigned this Apr 29, 2015
@zelig
Copy link
Contributor Author

zelig commented Apr 29, 2015

  • xeth:
    • ApplyTestTxs
    • UpdateState() simple state update loop for jsre
    • Solc solidity compiler for rpc + jsre
    • SetSolc set solc path from console
  • Tx confirmation frontend callback is in xeth rather than in ethereumApi
  • admin api changes:
    • added contract tests
    • simplify code, make errors uniform
    • refactor getblock from everything
    • sleep added
    • setSolc solidity compiler call from
    • contractInfo (need a name!) module
      • newRegistry officially not documented temporary option
      • start/stop to toggle natspec
      • get : get contract info
      • register : extract, serialise, hash, register on hashreg
      • registerUrl : url-hint scheme
    • debug api
      • waitForBlocks: lower level alternative to filters or blocktime based sleep command
  • new contract test (should use mining) and the waitforblocks contruct to sync
  • jsre xeth updated state for storage and code calls.
  • test overhaul
    • tester frontend now embeds jsre
    • the api xeth is now not shared between api and js, because they cannot have the same frontend
    • fix bug deleting data dir at the end of initialisation
    • preset testbalance at address, import account from test private key
  • cli utils/flags: add solc for compiler path
    • cmd exit not needed (left there from ages ago)
    • cli/admin: newAccount failures are non-fatal, in fact nothing should be fatal on console
    • cli/admin: Fatal errors now logged to both stderr and stdout (with encouraged 2>>log, console users may want to know why we exited)
  • natspec: enrich with contractInfo structure based on massaged compiler json output.
    • extract code for FetchDocsForContract also used by
    • simplify and refactor much of the end to end test, using xeth.ApplyTestTxs
    • resolver is also registry handler

@zelig zelig force-pushed the frontier/solidity branch 2 times, most recently from 471c149 to 65ca17f Compare April 30, 2015 09:08
@zelig zelig added review and removed in progress labels Apr 30, 2015
@zelig
Copy link
Contributor Author

zelig commented Apr 30, 2015

  • fixed cmd/geth/js_test.go contract test that broke travis when ni solc installed
  • fixed comfirmation message

travis broken on unrelated issiue

@obscuren
Copy link
Contributor

Restarting travis. If issue persist this is done in your PR. This doesn't fail anywhere else.

@obscuren obscuren removed this from the Frontier milestone Apr 30, 2015
@zelig
Copy link
Contributor Author

zelig commented May 1, 2015

why is travis so fragile suddenly?

The command "sudo apt-get install -yqq libgmp3-dev qt54quickcontrols qt54webengine" failed and exited with 100 during .


func (js *jsre) waitForBlocks(call otto.FunctionCall) otto.Value {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waits until block height is minimum the number given (guarded by timeout)
basically a sleep function on variable block units of time using a subscription to the chains head.

  • can be used like (wait for x confirmations), without filters.
  • between a mining start/stop session, it can be used to advance the blockchain in a piecemeal fashion on demand. good for debugging transaction inclusions on a private network while not waste resources, see this script:
    https://gist.github.com/zelig/21ac8eada617e56866d8
  • could be used in contract integration tests

[need to fix js argument handling]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has this been implemented? I can't find any call to it. I don't like methods for the sake of having them. If it isn't being used, please get rid of it.

EDIT: blocking main JS thread is imo a pretty bad idea. Success callback maybe?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implements the admin.debug.waitForBlocks method so it is not called in go but on the console or in a js file (see link above).

The mining example i show in the script was not possible since starting mining with the old big dag is not realistic in tests. This hack should be eliminated, once there is new ethash with minidag for tests. Then the xeth.ApplyTestTxs (used natspec and cmd/geth tests) should be replaced with a xeth.mineBlocks(n int)

As for the callback, I agree blocking the mainthread is incorrect IF we have real asynchrony, but until async send and watch are implemented we cannot have this as the single method offering async callback.
On the other hand, if async is properly implemented we can eliminate this method in favour of a filter:

eth.filter("latest", function(err, res) {
     if(num == 2)
           stopmining();
     num++;
})

@zelig
Copy link
Contributor Author

zelig commented May 6, 2015

updated as we discussed. can be merged but
if #771 satisfactory, i can get rid of waitForBlocks in favour of filters if they work.

* common/compiler: solidity compiler + tests
* rpc: eth_compilers, eth_compileSolidity + tests
* fix natspec test using keystore API, notice exp dynamically changes addr, cleanup
* resolver implements registrars and needs to create reg contract (temp)
* xeth: solidity compiler. expose getter Solc() and paths setter SetSolc(solcPath)
* ethereumApi: implement compiler related RPC calls using XEth - json struct tests
* admin: make use of XEth.SetSolc to allow runtime setting of compiler paths
* cli: command line flags solc to set custom solc bin path
* js admin api with new features debug and contractInfo modules
* wiki is the doc https://github.com/ethereum/go-ethereum/wiki/Contracts-and-Transactions
obscuren added a commit that referenced this pull request May 8, 2015
solidity compiler and contract metadocs integration
@obscuren obscuren merged commit 45c070f into ethereum:develop May 8, 2015
@zelig zelig deleted the frontier/solidity branch December 8, 2015 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants