Compare commits

...

2458 Commits

Author SHA1 Message Date
8cc6647ebf Merge branch 'release/0.8.5' 2015-02-22 13:26:18 +01:00
321dce1f47 Bump 2015-02-22 13:26:10 +01:00
bba85a2074 Added Number to logs 2015-02-22 13:24:26 +01:00
483d96a89d Added eth_logs & fixed issue with manual log filtering
* Implemented `eth_logs`
* Fixed issue with `filter.Find()` where logs were appended to an
  incorrect, non-returned slice resulting in no logs found
2015-02-22 13:12:01 +01:00
bba7ccb07f Merge branch 'hotfix/0.8.4-1' into develop 2015-02-21 00:53:47 +01:00
5912f0a849 Merge branch 'hotfix/0.8.4-1' 2015-02-21 00:53:39 +01:00
cb7cd03919 unlock mutex 2015-02-21 00:53:27 +01:00
bc541b918c Merge branch 'release/0.8.4' into develop 2015-02-21 00:43:31 +01:00
3c14902649 Merge branch 'release/0.8.4' 2015-02-21 00:43:04 +01:00
92337baa5a reverted back to proper version number 2015-02-21 00:42:57 +01:00
f9663b8f4f Fix test for Finney 2015-02-20 20:57:45 +01:00
113cf4208b Update build status links to https 2015-02-20 20:52:03 +01:00
703dc8299c Merge branch 'release/0.9.0' into develop 2015-02-20 18:14:53 +01:00
bd7ebbcd5b Merge branch 'release/0.9.0' 2015-02-20 18:13:46 +01:00
d586a633ff Updated readme 2015-02-20 18:13:39 +01:00
9feb657763 Turbo off 2015-02-20 18:06:45 +01:00
cc43ab9a81 Minor updates for release 2015-02-20 18:05:46 +01:00
66d5559866 Fixed chain event issue 2015-02-20 16:59:08 +01:00
82cae27737 Merge branch 'tgerring-rpcupdates' into develop 2015-02-20 15:18:32 +01:00
75625801f5 fixed merge 2015-02-20 15:18:07 +01:00
ea9a549bbd Removed exported fields from state object and added proper set/getters 2015-02-20 14:19:34 +01:00
5c975dd4ed Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-20 14:01:34 +01:00
d8ac267f41 dirty tracking for state objects fixed 2015-02-20 14:01:30 +01:00
63031f571a Merge pull request #355 from fjl/test-fixes
Fix failing tests and speed up Travis builds
2015-02-20 13:00:10 +01:00
982f73fa6d Added timeout for filter & removed clipboard. Closes #350 2015-02-20 12:59:54 +01:00
3b12a9293c .travis.yml: don't run gofmt, goimports, golint
This should yield another 30-second speed up. Nobody looks
at the output of those anyway. We might want bring back gofmt later
and actually fail the build if source is not formatted.
2015-02-20 12:21:05 +01:00
654f7f707c .travis.yml: speed up tests on Travis
This should decrease test runtime to about 30 seconds.
2015-02-20 12:18:29 +01:00
66abe2e3d4 gocoverage.sh: skip .
This is an attempt to get Travis working again.
2015-02-20 11:55:26 +01:00
b3b6210886 tests/vm: add non-test Go file
This removes the annoying warning printed by "go install ./...".
2015-02-20 11:40:58 +01:00
01ce066d43 state: improve TestDump 2015-02-20 11:40:58 +01:00
4ab7a290cd accounts: use crypto/randentropy in test 2015-02-20 11:40:58 +01:00
81dea2d8e7 update-license.go: add blank line after build tag
This silences "go install ./...". For some reason it started
complaining with go 1.4.2.
2015-02-20 11:40:20 +01:00
0006585391 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-19 22:46:15 +01:00
639ac5c3da Merge pull request #352 from fjl/no-enc-handshake
p2p: disable encryption handshake, enable log events
2015-02-19 22:46:07 +01:00
765740b829 Merge pull request #345 from maran/feature/minerthreads
Implement command line argument to set the amount miner threads
2015-02-19 22:37:13 +01:00
07c34751da Merge pull request #335 from alexvandesande/ui
Cut, Copy, Undo and Redo working in webview
2015-02-19 22:36:35 +01:00
fa4cbad315 Optimisations and fixed a couple of DDOS issues in the miner 2015-02-19 22:33:22 +01:00
a59cd94625 Add setMining RPC method 2015-02-19 18:58:15 +01:00
605dd3a982 Add serpent compilation to RPC 2015-02-19 18:41:50 +01:00
3719db352a p2p: emit JSON connect/disconnect events 2015-02-19 17:09:33 +01:00
fa15854a54 logger: add P2P disconnected event 2015-02-19 17:09:13 +01:00
dd871e791c p2p: initialize Server.ourHandshake before accepting connections 2015-02-19 17:08:18 +01:00
3dbd32093c p2p: enable devp2p ping
This should prevent connection drops.
2015-02-19 16:54:54 +01:00
1ec6190e86 cmd/mist: show peer names in peers window 2015-02-19 16:54:53 +01:00
73f94f3755 p2p: disable encryption handshake
The diff is a bit bigger than expected because the protocol handshake
logic has moved out of Peer. This is necessary because the protocol
handshake will have custom framing in the final protocol.
2015-02-19 16:54:53 +01:00
c14071df9d Reset storage cache after sync 2015-02-19 13:34:27 +01:00
dba4f3122e Added uninstall filter methods 2015-02-19 13:21:37 +01:00
4322632c59 Merge pull request #339 from tgerring/jsonlog
JSON log updates
2015-02-19 12:25:45 +01:00
0057bb4ef6 WIP QT Clipboard 2015-02-19 11:51:38 +01:00
03b8c6841b Topics => Topic. Closes #343 2015-02-19 11:49:58 +01:00
fdecc11128 Temp fix for #342 2015-02-19 11:09:46 +01:00
5aff8bfb59 Implement command line argument to set the amount of agents created by the miner
Defaults to the amount of cores available on the CPU
2015-02-19 10:38:36 +01:00
487c5cc294 Added WIP number package 2015-02-18 17:18:07 +01:00
ee9df32dba Added errors 2015-02-18 16:08:51 +01:00
655e942597 Added GetBlock GetUncle with OOB guard 2015-02-18 13:14:21 +01:00
be90ad89a8 Disable turbo 2015-02-18 12:01:20 +01:00
05b1ec008b Disabled ability to disable whisper. Closes #334 2015-02-18 11:42:01 +01:00
07bdba687f Re-add LogFormat to Config 2015-02-18 10:52:36 +01:00
f499f343ba Update JSON Log types 2015-02-18 10:52:23 +01:00
acd93c2971 Removed console logs from mist.js
also fixed an issue where it would force reloads unnecessarily
2015-02-18 10:25:40 +01:00
60318c96d0 removed old wallet 2015-02-17 23:22:42 +01:00
c1d0693cb1 Merge pull request #325 from fjl/deps-cleanup
Cleanup imports
2015-02-17 23:19:45 +01:00
5ec8c5f71b added bootnode back in 2015-02-17 23:14:10 +01:00
c1474e1877 Removed mined transactions from pending view. Closes #321 2015-02-17 23:10:37 +01:00
26d58e0446 Forgot to add the case for logs. Closes #336 2015-02-17 22:46:30 +01:00
7fc9b5b3f9 Changed to ChainEvent and fixed a nil pointer in transact 2015-02-17 22:20:47 +01:00
0e2f6691bf Cut, Copy, Undo and Redo working in webview 2015-02-17 17:37:26 +01:00
11e12680eb Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-17 16:55:20 +01:00
13c00afc68 Implement register and watchTx 2015-02-17 16:54:52 +01:00
5022b618aa Merge pull request #327 from fjl/udp-out-of-range
p2p/discover: fix pending replies iteration
2015-02-17 16:22:41 +01:00
5238b9439e Merge branch 'alexvandesande-ui' into develop 2015-02-17 16:18:40 +01:00
9a2be227a6 commented peer count out 2015-02-17 16:18:29 +01:00
fe94622ea3 Merge branch 'ui' of https://github.com/alexvandesande/go-ethereum into develop 2015-02-17 16:13:06 +01:00
567428fb34 Filter and mutex locks added 2015-02-17 16:12:55 +01:00
815ead7107 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-17 16:09:25 +01:00
7ea131d4ff p2p/discover: fix pending replies iteration
Range expressions capture the length of the slice once before the first
iteration. A range expression cannot be used here since the loop
modifies the slice variable (including length changes).
2015-02-17 15:21:39 +01:00
547788b1b0 Added optional address slice. Closes #326 2015-02-17 14:19:05 +01:00
417f018498 Updated P2PConnected log fields 2015-02-17 13:30:25 +01:00
2c454863f2 Use new rlp (TODO requires some refactoring) 2015-02-17 13:26:21 +01:00
f965f41b6e p2p/nat: switch to github.com/huin/goupnp
My temporary fix was merged upstream.
2015-02-17 13:10:11 +01:00
119bea22aa crypto: switch to golang.org/x/crypto
code.google.com/p/go.crypto is deprecated and will cause
problems in future versions of Go.
2015-02-17 13:05:58 +01:00
bb346a3ae1 rpc/ws: switch to golang.org/x/net
code.google.com/p/go.net is deprecated and will cause
problems in future versions of Go.
2015-02-17 12:37:09 +01:00
abb9b7f46f Merge branch 'develop' into ui 2015-02-17 12:29:10 +01:00
c934222a80 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-17 12:25:25 +01:00
8135752a32 "centralised" mining to backend. Closes #323 2015-02-17 12:24:58 +01:00
34d0e1b2c3 p2p: fix ecies dependency in tests
We forgot to update this reference when moving ecies into the
go-ethereum repo.
2015-02-17 12:04:20 +01:00
fbd5e4d5af Updated icons 2015-02-17 11:52:22 +01:00
0de1d1dd58 removed status bar code 2015-02-17 11:23:28 +01:00
a22711a7b5 badge support 2015-02-17 11:22:52 +01:00
c4b8c11529 side icons 2015-02-17 00:52:40 +01:00
666ef48239 SideIcons work. Copy paste still doesn't. 2015-02-16 20:55:14 +01:00
643eda5c2d Update obscuren/qml revision 2015-02-16 19:43:27 +01:00
cb34502728 Add godep usage information 2015-02-16 17:59:54 +01:00
9796feccb7 Add Docker Hub link to automated builds 2015-02-16 17:51:33 +01:00
c0ce323092 Use explicit branch and godep 2015-02-16 17:00:57 +01:00
3068e2688d merge conflicts 2015-02-16 14:43:30 +01:00
68f6ddc5aa Update Travis to use godep 2015-02-16 14:34:50 +01:00
1878630b59 Solved Issue #318 and added states to back button 2015-02-16 14:34:47 +01:00
702218008e Add versioned dependencies from godep 2015-02-16 14:28:33 +01:00
202362d925 Merge branch 'develop' of github.com:ethereum/go-ethereum into develop 2015-02-16 14:20:54 +01:00
393267489c Use Go binary instead of building from source 2015-02-16 13:40:51 +01:00
a92bcbb795 Use latest Trusty version 2015-02-16 13:37:29 +01:00
164de5e22b Changed default denominators 2015-02-16 13:20:16 +01:00
8f69b5c7a2 Added invalid sec key test 2015-02-16 13:19:57 +01:00
d68e607aa5 Group Qt dependencies together 2015-02-16 12:12:14 +01:00
d2a4bc4d73 Removed reference to lastBlockNumber & LastBlockNumber 2015-02-16 12:03:27 +01:00
f63c4a9bcb Ignore locally built binaries 2015-02-16 11:42:33 +01:00
05f2808849 Add http when not present on browser 2015-02-16 11:17:31 +01:00
2c3a014f03 Resolved some bugs in the miner
* TODO nonce error sometimes persists
* Fixed mining on wrong blocks
* Fixed state error & receipt fail
2015-02-15 16:16:27 +01:00
c924a841c7 Merge branch 'develop' into bounty 2015-02-15 02:29:52 +01:00
7299eb72e0 HTTP RPC only listen on localhost 2015-02-15 02:26:30 +01:00
238f39a42e Validate seckey when generating pub key 2015-02-15 02:20:31 +01:00
09e53367a2 Use a mutex write-lock for a write operation 2015-02-15 02:13:24 +01:00
b143dad596 Reference pointer to block instead of pointer to function 2015-02-15 02:09:57 +01:00
16ae675107 Unmarshal in to pointer to string 2015-02-15 02:08:08 +01:00
12fc590b34 removed some old menu items 2015-02-15 01:58:15 +01:00
c29b01ce75 Reset URL bar 2015-02-14 17:18:28 +01:00
befb4bc1c1 Fixed a few errors in the browser special meta tags objects 2015-02-14 17:13:21 +01:00
32c7ebc51d Fixed mining & limited hash power 2015-02-14 16:52:14 +01:00
65159d65c8 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-14 00:27:46 +01:00
3ff6c9bb79 Merge pull request #309 from fjl/peer-window
Fix Mist Peers Window
2015-02-14 00:27:40 +01:00
84f7c966f7 Moved ECIES to repo & added secondary title for webview
* ECIES moved from obscuren to ethereum
* Added html META[name=badge] to reflect menuItem.secondaryTitle
2015-02-14 00:25:47 +01:00
8464e43eaf cmd/mist: fix peer window 2015-02-14 00:12:37 +01:00
4bef3ce284 p2p: print Cap as name/version 2015-02-13 23:54:34 +01:00
396f1a0a33 Add 'crypto/ecies/' from commit '7c0f4a9b18d992166452d8cd32caaefd92b26386'
git-subtree-dir: crypto/ecies
git-subtree-mainline: 49a739c8d6
git-subtree-split: 7c0f4a9b18
2015-02-13 23:45:38 +01:00
7c0f4a9b18 Merge pull request #3 from Gustav-Simonsson/fix_ecies_params_init_bug
Fix ECIES params nil bug
2015-02-13 23:42:33 +01:00
49a739c8d6 Merge branch 'Gustav-Simonsson-align_key_and_ecdsa_nonce_entropy' into develop 2015-02-13 23:35:21 +01:00
12b2d57629 Merge branch 'align_key_and_ecdsa_nonce_entropy' of https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-align_key_and_ecdsa_nonce_entropy 2015-02-13 23:31:20 +01:00
95cfaa1b37 disabled test 2015-02-13 23:26:41 +01:00
acc7c0f706 Merge pull request #308 from fjl/default-bootnodes
eth: add default bootnode
2015-02-13 21:51:51 +01:00
1c1a3033be eth: add default bootnode 2015-02-13 21:41:13 +01:00
384305f4aa Fixed QML errors 2015-02-13 18:33:08 +01:00
7aef0fed29 changed url bar behaviour. Failed attempt at icon 2015-02-13 18:32:15 +01:00
4d49d7b5a6 Reset hash rate to 0 when mining is stopped 2015-02-13 18:30:06 +01:00
f35d62b759 Remove secp256_rand.go and update tests 2015-02-13 18:25:25 +01:00
6a7b0ef904 Updated coin.js abi 2015-02-13 18:17:17 +01:00
ce239333d5 Update balance label when mining 2015-02-13 18:15:23 +01:00
0f3c25b265 Propagate blocks 2015-02-13 18:03:16 +01:00
790de35e7f Fixed issue in peer window
* Fixed issues where new peer window could cause a crash when entering
  an empty string
2015-02-13 17:57:46 +01:00
218f437b0c Updated window 2015-02-13 17:30:37 +01:00
7336dfad02 Merge branch 'develop' into poc8 2015-02-13 17:23:48 +01:00
00fca40939 Merge branch 'miner' into develop 2015-02-13 17:23:18 +01:00
8a0f23915e Fixed a few issues in the miner and updated hash rate title
* Sometimes old nonces were set by "old" agents
* Added the hash rate to the miner
2015-02-13 17:23:09 +01:00
8305d409d2 Merge branch 'develop' into miner 2015-02-13 17:00:15 +01:00
5c251b6928 Merge branch 'fjl-poc8-net-integration' into develop 2015-02-13 16:08:30 +01:00
bde3ff16ad merge 2015-02-13 16:02:37 +01:00
39434e383b Unexport randEntropy type and use exported Reader instead 2015-02-13 15:38:26 +01:00
76fa75b394 wip 2015-02-13 15:35:54 +01:00
32a9c0ca80 p2p: bump devp2p protcol version to 3
For compatibility with cpp-ethereum
2015-02-13 15:08:40 +01:00
fd3e1061e0 p2p: handle disconnect before protocol handshake 2015-02-13 15:06:47 +01:00
cf754b9483 p2p/discover: fix race in ListenUDP
udp.Table was assigned after the readLoop started, so
packets could arrive and be processed before the Table was there.
2015-02-13 15:06:47 +01:00
5cc1256fd6 p2p: ensure we don't dial ourself
addPeer doesn't allow self connects, but we can avoid opening
connections in the first place.
2015-02-13 15:06:47 +01:00
7101f44998 p2p: add I/O timeout for encrytion handshake 2015-02-13 15:06:47 +01:00
22ee366ed6 p2p: fix goroutine leak for invalid peers
The deflect logic called Disconnect on the peer, but the peer never ran
and wouldn't process the disconnect request.
2015-02-13 15:06:46 +01:00
75d164037f Merge branch 'logjson' into develop 2015-02-13 15:06:32 +01:00
a5ea21cd85 merge 2015-02-13 15:05:56 +01:00
5110f80bba p2p: improve read deadlines
There are now two deadlines, frameReadTimeout and payloadReadTimeout.

The frame timeout is longer and allows for connections that are idle.
The message timeout is still short and ensures that we don't get stuck
in the middle of a message.
2015-02-13 14:44:00 +01:00
170eb3ac68 p2p/discover: map listening port using configured mechanism 2015-02-13 11:39:32 +01:00
82f0bd9009 p2p/discover: code review fixes 2015-02-13 11:39:31 +01:00
d0a2e655c9 cmd/ethereum, cmd/mist, eth, p2p: use package p2p/nat
This deletes the old NAT implementation.
2015-02-13 11:39:31 +01:00
1543833ca0 p2p/nat: new package for port mapping stuff
I have verified that UPnP and NAT-PMP work against an older version of
the MiniUPnP daemon running on pfSense. This code is kind of hard to
test automatically.
2015-02-13 11:39:31 +01:00
38faf2c51a removed messages 2015-02-12 17:06:15 +01:00
31fdc645ed cmd + t switches to new dapp window 2015-02-12 15:03:53 +01:00
5136fc9ab7 Fix ECIES params nil bug
* Change ECIES params init function to static var as it does not have
  state; fixes TestMarshalencryption.
2015-02-12 02:35:35 +01:00
04c1a81509 Merge pull request #2 from Gustav-Simonsson/correct_ecies_shared_key_generation
Correct ECIES shared key length check
2015-02-12 00:10:00 +01:00
b64ad7a2a6 Merge branch 'develop' into miner 2015-02-11 23:46:54 +01:00
3f6baa45a7 Documented methods & removed old manifest 2015-02-11 23:46:45 +01:00
52a46e61f9 Correct ECIES shared key length check
* Ensure the ECIES shared key is padded with zero bytes if it's
  smaller than the requested key length.
* Split the ECIES shared key error into two;
  one for when the generated key is too big for the params
  and one for when it's nil (point of infinity returned by the
  curve scalar multiplication).
2015-02-11 20:28:42 +01:00
558c67d392 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-11 20:22:19 +01:00
d73dff4d5b Merge pull request #303 from fjl/rlp-flat
rlp: add Flat
2015-02-11 20:22:04 +01:00
b94f85de22 rlp: add Flat 2015-02-11 19:28:56 +01:00
1fc3524e40 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-11 19:22:38 +01:00
ebc506dae8 Merge pull request #302 from alexvandesande/UI
Catalog Page Behaviour
2015-02-11 19:22:23 +01:00
6221b282d4 Catalog Page Behaviour 2015-02-11 19:16:35 +01:00
db24fb792c Move standard fields to LogEvent 2015-02-11 18:49:00 +01:00
d311b1b9b7 Merge pull request #301 from ethereum/travis
Updates to Travis config
2015-02-11 14:25:44 +01:00
3c40eb9e5a Temporarily skip broken TestVerifyPoW 2015-02-11 13:47:03 +01:00
df49c609a0 updated coin 2015-02-11 13:26:44 +01:00
3d6fd601c5 Move event names within each object 2015-02-11 12:45:41 +01:00
ef6c7bd726 Merge pull request #300 from tgerring/jsonrpc
Allow RPC ID to be string or null
2015-02-11 11:59:51 +01:00
d613bf69bf #295 Allow RPC ID to be string 2015-02-11 11:56:29 +01:00
cfddb7f3cd Merge branch 'develop' into jsonrpc
Conflicts:
	rpc/ws/server.go
2015-02-11 11:40:12 +01:00
c6af5f0a27 No longer switch branches for go-qml dep 2015-02-11 11:30:36 +01:00
e433525f51 Merge branch 'sveneh-origin_develop' into develop 2015-02-11 11:28:39 +01:00
ab66a3d0d3 Merge branch 'origin_develop' of https://github.com/sveneh/go-ethereum into sveneh-origin_develop 2015-02-11 11:03:40 +01:00
8c056aebe1 Set both key generation and ECDSA nonce to use mixed entropy
* Move random entropy functions to new package randentropy
* Add function to get n bytes entropy where up to first 32
  bytes are mixed with OS entropy sources
2015-02-10 22:49:28 +01:00
d53e5646ec Use strongly-typed objects 2015-02-10 19:21:13 +01:00
5fe2916ee1 Merge pull request #298 from alexvandesande/UI
UI changes to Mist
2015-02-10 17:21:29 +01:00
acc667fbef Merge pull request #296 from frewsxcv/patch-1
Fix broken link in README
2015-02-10 16:41:32 +01:00
80890cd9dd removed icomoon 2015-02-10 16:16:17 +01:00
6b5f4ed244 Recreated the changes on a new branch 2015-02-10 16:14:07 +01:00
4242b05462 cmd/bootnode: new command (replaces cmd/peerserver) 2015-02-10 14:26:54 +01:00
a21b30c901 eth: remove unused Ethereum sync fields 2015-02-10 13:30:07 +01:00
ddccea75e8 Fixed "to" field 2015-02-10 13:20:06 +01:00
da2fae0e43 Basic structure miner 2015-02-10 13:04:38 +01:00
a3cd218719 cmd/mist, cmd/ethereum: add CLI arguments for node key 2015-02-10 12:30:09 +01:00
0c7df37351 crypto: add key loading functions 2015-02-10 12:29:50 +01:00
70e2df3904 Dockerfile creation speed-up by not running go tests, added a workaround
so that docker's cache is invalidated whenever th git repo is updated.
2015-02-09 16:27:49 +01:00
f1ebad2508 eth: don't warn if no BootNodes are specified 2015-02-09 16:17:07 +01:00
9915d3c3be p2p/discover: deflake UDP tests 2015-02-09 11:02:32 +01:00
58ba290a9f moved manager 2015-02-09 00:08:28 +01:00
b22f0f2ef5 merged 2015-02-09 00:06:24 +01:00
16a04e64f2 Updated coin 2015-02-07 17:04:19 +01:00
c8147fb7b9 Compare regardless of length 2015-02-07 17:04:04 +01:00
0fa6927171 Moved log message to detail output 2015-02-07 17:03:33 +01:00
99ebb869bf Fixed iterator 2015-02-07 17:03:22 +01:00
44eafb15e0 Renamed filter 2015-02-07 17:03:12 +01:00
792cd0aa10 Fix broken link in README 2015-02-06 22:36:22 -05:00
028775a086 cmd/ethereum, cmd/mist: add flag for discovery bootstrap nodes 2015-02-07 00:52:49 +01:00
2cf4fed11b cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions 2015-02-07 00:46:56 +01:00
e34d134102 p2p: fixes for actual connections
The unit test hooks were turned on 'in production'.
2015-02-07 00:43:52 +01:00
8564eb9f7e p2p/discover: add node URL functions, distinguish TCP/UDP ports
The discovery RPC protocol does not yet distinguish TCP and UDP ports.
But it can't hurt to do so in our internal model.
2015-02-07 00:12:23 +01:00
e4bb419707 Add go check to prefetched test dependencies 2015-02-05 18:11:31 -06:00
5e0b2b260c Updated go list command 2015-02-05 17:49:44 -06:00
b58b6b9bac Use after_success build step 2015-02-05 17:23:22 -06:00
f3ac378ca4 No long use v1 branch of qml repo 2015-02-05 17:13:51 -06:00
56f777b2fc cmd/ethereum, cmd/mist, core, eth, javascript, xeth: fixes for new p2p API 2015-02-06 00:03:59 +01:00
e40c1c62ce API changed to use Pubkey only. Reflected that change in the rest of the api 2015-02-05 15:00:59 -08:00
8e8ec8f5f8 cmd/peerserver: is gone
Will be back soon. Maybe.
2015-02-06 00:00:36 +01:00
5bdc115943 p2p: integrate p2p/discover
Overview of changes:

- ClientIdentity has been removed, use discover.NodeID
- Server now requires a private key to be set (instead of public key)
- Server performs the encryption handshake before launching Peer
- Dial logic takes peers from discover table
- Encryption handshake code has been cleaned up a bit
- baseProtocol is gone because we don't exchange peers anymore
- Some parts of baseProtocol have moved into Peer instead
2015-02-06 00:00:36 +01:00
739066ec56 p2p/discover: add some helper functions 2015-02-06 00:00:36 +01:00
12224c7f59 p2p/discover: new package implementing the Node Discovery Protocol 2015-02-06 00:00:36 +01:00
8c3095faf0 rlp: fix encoding of arrays with byte element type 2015-02-06 00:00:36 +01:00
410b35e913 crypto: make it easier to run Sha3 on multiple inputs
crypto.Sha3(append(foo, bar)) --> crypto.Sha3(foo, bar)
crypto.Sha3([]byte{}) --> crypto.Sha3()
2015-02-06 00:00:36 +01:00
2e48d39fc7 key generation abstracted out, for testing with deterministic keys 2015-02-06 00:00:36 +01:00
488a042736 fix clientidentity test after privkey removed 2015-02-06 00:00:36 +01:00
71765957e4 get rid of Private Key in ClientIdentity 2015-02-06 00:00:36 +01:00
68205dec9f make crypto handshake calls package level, store privateKey on peer + tests ok 2015-02-06 00:00:36 +01:00
4499743522 apply handshake related improvements from p2p.crypto branch 2015-02-06 00:00:35 +01:00
54252ede31 add temporary forced session token generation 2015-02-06 00:00:35 +01:00
faa069a126 peer-level integration test for crypto handshake
- add const length params for handshake messages
- add length check to fail early
- add debug logs to help interop testing (!ABSOLUTELY SHOULD BE DELETED LATER)
- wrap connection read/writes in error check
- add cryptoReady channel in peer to signal when secure session setup is finished
- wait for cryptoReady or timeout in TestPeersHandshake
2015-02-06 00:00:35 +01:00
20aade56c3 chop first byte when cryptoid.PubKeyS is set from identity.Pubkey() since this is directly copied in the auth message 2015-02-06 00:00:35 +01:00
1f2adb05b5 add initial peer level test (failing) 2015-02-06 00:00:35 +01:00
4afde4e738 add code documentation 2015-02-06 00:00:35 +01:00
364b783281 changes that fix it all:
- set proper public key serialisation length in pubLen = 64
- reset all sizes and offsets
- rename from DER to S (we are not using DER encoding)
- add remoteInitRandomPubKey as return value to respondToHandshake
- add ImportPublicKey with error return to read both EC golang.elliptic style 65 byte encoding and 64 byte one
- add ExportPublicKey falling back to go-ethereum/crypto.FromECDSAPub() chopping off the first byte
- add Import - Export tests
- all tests pass
2015-02-06 00:00:35 +01:00
58fc2c679b important fix for peer pubkey. when taken from identity, chop first format byte! 2015-02-06 00:00:35 +01:00
923504ce3d add equality check for nonce and remote nonce 2015-02-06 00:00:35 +01:00
2e868566d7 add minor comments to the test 2015-02-06 00:00:35 +01:00
e252c634cb first stab at integrating crypto in our p2p
- abstract the entire handshake logic in cryptoId.Run() taking session-relevant parameters
- changes in peer to accomodate how the encryption layer would be switched on
- modify arguments of handshake components
- fixed test getting the wrong pubkey but it till crashes on DH in newSession()
2015-02-06 00:00:35 +01:00
1803c65e40 integrate cryptoId into peer and connection lifecycle 2015-02-06 00:00:35 +01:00
489d956283 completed the test. FAIL now. it crashes at diffie-hellman. ECIES -> secp256k1-go panics 2015-02-06 00:00:35 +01:00
076c382a74 handshake test to crypto 2015-02-06 00:00:35 +01:00
3b6385b146 handshake test to crypto 2015-02-06 00:00:34 +01:00
714b955d6e fix crash
- add session token check and fallback to shared secret in responder call too
- use explicit length for the types of new messages
- fix typo resp[resLen-1] = tokenFlag
2015-02-06 00:00:34 +01:00
b855f671a5 rewrite to comply with latest spec
- correct sizes for the blocks : sec signature 65, ecies sklen 16, keylength 32
- added allocation to Xor (should be optimized later)
- no pubkey reader needed, just do with copy
- restructuring now into INITIATE, RESPOND, COMPLETE -> newSession initialises the encryption/authentication layer
- crypto identity can be part of client identity, some initialisation when server created
2015-02-06 00:00:34 +01:00
4e52adb84a add crypto auth logic to p2p 2015-02-06 00:00:34 +01:00
d227f6184e fix protocol to accomodate privkey 2015-02-06 00:00:34 +01:00
88167f39a6 add privkey to clientIdentity + tests 2015-02-06 00:00:34 +01:00
c8a8aa0d43 initial hook for crypto handshake (void, off by default) 2015-02-06 00:00:34 +01:00
6b5f25802e Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-05 14:42:22 -08:00
f8c1eb157d Undone fix. Will re-enable once chain resets 2015-02-05 14:42:12 -08:00
59665ade85 Pin Travis go version to 1.4.1 2015-02-05 16:27:54 -06:00
c1f6e259a9 Only submit on coverage report success 2015-02-05 16:04:42 -06:00
03b89ab712 Only download missing deps, not build 2015-02-05 16:03:29 -06:00
ae3e9d4881 Don't reference by $GOROOT 2015-02-05 16:02:15 -06:00
cad53fa191 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Conflicts:
	README.md
2015-02-05 12:36:30 -08:00
0e682d936d Updated readme 2015-02-05 12:35:46 -08:00
cec30e23b2 Updated readme 2015-02-05 12:34:47 -08:00
47129428fe Merge pull request #290 from Gustav-Simonsson/correct_block_parent_timestamp_check
Correct block parent timestamp check and typos
2015-02-05 12:23:56 -08:00
2f30a27b2b Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-05 12:22:44 -08:00
8be1d134aa updated home 2015-02-05 12:22:35 -08:00
7e0799ff21 Merge commit '9d84609b3faf797f4a611587abdda3d6b3b07917' into develop 2015-02-05 12:07:36 -08:00
9d84609b3f Merge branch 'master' of https://github.com/ethereum/ethereum.js 2015-02-05 21:06:50 +01:00
c64852dbcc pending / chain event 2015-02-05 11:55:03 -08:00
bcacaaa4f4 Merge branch 'tgerring-develop' into develop 2015-02-05 11:44:45 -08:00
d00e2731e5 Merge branch 'develop' of https://github.com/tgerring/go-ethereum into tgerring-develop
Conflicts:
	rpc/http/server.go
2015-02-05 11:44:30 -08:00
99a1551b20 Merge pull request #287 from ethereum/system-testing
Seednode CLI param updates
2015-02-05 11:09:13 -08:00
ac69538707 Merge branch 'develop' into miner 2015-02-05 10:58:43 -08:00
82cc5f63ae bring back jsonrpc single method calls in polling 2015-02-05 18:20:43 +01:00
9d2166a964 wip 2015-02-05 09:13:02 -08:00
db7c34a9df Default gas price and default gas for rpc 2015-02-04 18:34:29 -08:00
a1b4547a53 set uncles regardless of empty uncle list. Fixes invalid blocks being mined 2015-02-04 18:26:23 -08:00
57f95c1dc7 fixed test 2015-02-04 17:35:49 -08:00
1d519854e2 Propagate known transactions to new peers on connect 2015-02-04 17:28:54 -08:00
292f7ada8e Merge branch 'develop' into miner 2015-02-04 15:05:49 -08:00
65158d39b0 Filtering 2015-02-04 15:05:47 -08:00
7c278d6ac2 updated tests 2015-02-04 12:52:34 -08:00
429077a5a0 Merge branch 'develop' of github.com:tgerring/go-ethereum into develop 2015-02-04 10:58:18 -06:00
2656a2d038 Use different default RPC port per #186 2015-02-04 10:57:47 -06:00
3f03197dae Updated tests 2015-02-04 07:39:02 -08:00
b1870631a4 WIP miner 2015-02-04 05:53:22 -08:00
859a1999cb Merge pull request #55 from ethereum/develop
fixed jsonrpc result field 0 not handled properly
2015-02-04 11:26:19 +01:00
f3e1797153 fixed jsonrpc response 0 not handled properly 2015-02-04 11:23:23 +01:00
55ed0ff07c Update RPC message format 2015-02-03 17:29:29 -06:00
07590196a5 Merge branch 'develop' of github.com:tgerring/go-ethereum into develop 2015-02-03 17:18:20 -06:00
697c2b5dc1 Correct block parent timestamp check and typos 2015-02-03 23:09:39 +01:00
a0cfa3ca21 version upgrade 2015-02-03 23:02:24 +01:00
e58e2f5ee4 jsonrpc.js tests && jsonrpc response validation is more strict 2015-02-03 23:00:02 +01:00
45134de740 jsonrpc.js file && batch polling 2015-02-03 22:24:17 +01:00
f3ce1f07c4 simplified polling && jsonrpc payload creation 2015-02-03 21:43:39 +01:00
ddc17196da tests && fixes for utils methods 2015-02-03 20:12:56 +01:00
fdcc1af4e2 clearing tests 2015-02-03 19:48:51 +01:00
4a54b8c451 version upgrade 0.0.12 2015-02-03 16:58:49 +01:00
4dc283c0fb Removed minimum height. Closes #282 2015-02-03 07:54:50 -08:00
f1a5cf9128 Merge branch 'develop' into cpp
Conflicts:
	dist/ethereum.js.map
	dist/ethereum.min.js
2015-02-03 16:20:26 +01:00
a5909d82eb parsing events output 2015-02-03 16:16:38 +01:00
59b7386abb Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-02-03 07:16:14 -08:00
7bd2fbe2b1 Fixed whisper "to" filtering. Closes #283 2015-02-03 07:16:05 -08:00
623469cb6c Added missing whisper timestamp. Closes #284 2015-02-03 06:56:19 -08:00
663d725026 Added a different default home page 2015-02-03 06:54:41 -08:00
1860b3dff9 gulp 2015-02-03 15:08:36 +01:00
03faec9d41 event outputParser && tests 2015-02-03 15:08:19 +01:00
30fa30bd4a Docs & old code removed 2015-02-02 20:02:00 -08:00
faa54e59c1 Make sure that CALL addr is always 20 bytes 2015-02-02 20:01:10 -08:00
93ae7bb0d2 Raw data for existing blocks 2015-02-02 19:58:58 -08:00
3c7181d28f Fixed a copy issue in the trie which could cause a consensus failure 2015-02-02 19:58:34 -08:00
6fecb150d6 Updated tests 2015-02-02 19:55:38 -08:00
1f4ed49b4c Move hardcoded seed node address to app flag
Replaces functionality `-seed=true` with `-seed="ip:port"`
2015-02-02 13:04:00 -06:00
57c6caf146 Separate Coveralls submission from coverage script 2015-02-02 12:14:04 -06:00
4bb5ba78b0 reverted ethereum.js 2015-02-02 18:20:43 +01:00
9d9c23e315 common cleanup 2015-02-02 17:40:05 +01:00
1a6b7de0af removed splitter.qml 2015-02-02 16:47:18 +01:00
b2b42f759c Update signature for rpc websockets 2015-02-02 07:37:44 -06:00
7139c1aff7 Decrease log level for Sending RPC payload 2015-02-02 07:30:22 -06:00
1e60919d47 Merge pull request #3 from ethereum/develop
Update to develop
2015-02-02 07:22:20 -06:00
011fdd91df event_inc example 2015-02-02 11:52:56 +01:00
0994efa66f Better HTML template in Mix.
Use happened in JS.
Debugging QML enabled.
2015-02-01 22:51:14 -08:00
8ccde784f9 Added (disabled) Jit validation 2015-02-01 15:30:29 +01:00
d52878c744 Removed some VMEnv & Added VmType() to vm.Environment 2015-02-01 15:29:57 +01:00
d5166918e9 fixed event signatures 2015-01-31 19:07:59 +01:00
0d97c3ce13 Merge branch 'bounty' into develop 2015-01-31 17:50:43 +01:00
19cff8ecca Fixed n 2015-01-31 17:50:28 +01:00
bb2e847363 Merge branch 'bounty' into develop 2015-01-31 17:44:42 +01:00
a008c21cf0 Fixed Sign nonce 2015-01-31 17:44:34 +01:00
9016ce8dd8 Merge branch 'bounty' into develop 2015-01-31 17:23:50 +01:00
79cd58bdf3 removed old code 2015-01-31 17:23:46 +01:00
d1e5d92191 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-01-31 17:23:37 +01:00
cb382fa76b Validate transactions sender before adding to pool. Closes #272 2015-01-31 17:22:17 +01:00
e6c0ec7278 version upgrade 2015-01-31 16:02:51 +01:00
3cdf108057 Merge branch 'develop' 2015-01-31 16:02:16 +01:00
688030ecb6 eth.filter next param optional 2015-01-31 16:01:41 +01:00
589c4fb30f formatInput && formatOutput simplified 2015-01-31 15:48:49 +01:00
b20e972bec few methods moved to utils 2015-01-31 15:22:05 +01:00
a8a2e3231c constants separated to const.js file 2015-01-31 14:05:48 +01:00
4bdf52fc1e toAscii && fromAscii moved to utils 2015-01-31 13:54:39 +01:00
0b82a05a75 events 2015-01-31 04:09:48 +01:00
80c97ca21b events 2015-01-31 03:42:13 +01:00
2491c99b37 abi.js cleanup && new types.js, utils.js 2015-01-31 02:54:17 +01:00
cf534d4726 gulp 2015-01-31 01:54:46 +01:00
5689086202 formatters separated 2015-01-31 01:52:36 +01:00
bd64ed1e93 Update coveralls badge to develop branch 2015-01-30 18:47:25 -06:00
995861de4d event options 2015-01-31 01:30:19 +01:00
56a0131778 Travis fixes for Qt5.4 2015-01-30 17:24:51 -06:00
0bb3943698 Updated for Qt5.4 2015-01-30 11:49:52 -06:00
2d9b3aa537 Removed debug log 2015-01-30 17:00:33 +01:00
8e14545282 added new default favicon 2015-01-30 15:54:43 +01:00
2eedc330bf contract with array example 2015-01-30 15:45:00 +01:00
0ed3edc99e "fixed" transaction view 2015-01-30 14:49:45 +01:00
0c0708076e added disasm 2015-01-30 14:41:14 +01:00
3847e248df Bumped version number 2015-01-30 14:37:07 +01:00
af927ffdaf Added whisper messages
* have identity & get messages
2015-01-30 13:47:18 +01:00
c03d403437 Added whisper interface for xeth, added examples, updated RPC
* Added RPC methods for whisper
* Added whisper example
2015-01-30 13:25:12 +01:00
c48644490f Fixed whisper pub key bug
* Unrecoverable messages would cause segfault when recovering invalid
  pub key
2015-01-30 13:24:20 +01:00
54927dc0e0 Fixed issue with Storage()
* Storage() returned encoded values. They are now decode prior to hexing
* Removed old code from state object
* Updated coin
2015-01-29 23:58:43 +01:00
705cf6113d debug err removed 2015-01-29 23:18:46 +01:00
9022f5034f default values removed 2015-01-29 23:17:43 +01:00
bd992e7baf Merge branch 'qt5.4' of github.com-obscure:ethereum/go-ethereum into qt5.4
Conflicts:
	rpc/message.go
2015-01-29 20:41:10 +01:00
0031f388ac More dapp samples
* Info DApp, coin DApp
* Additional rpc methods
2015-01-29 20:39:26 +01:00
447bad9dbd Travis fix
Satisfy dependency for obscuren/qml fork
2015-01-29 12:12:19 -06:00
89a48e365c Cleanup 2015-01-29 11:39:59 -06:00
1cfea1113a Merge branch 'qt5.4' of github.com:ethereum/go-ethereum into qt5.4 2015-01-29 11:28:55 -06:00
6488a392a3 Reimplemented message filters for rpc calls 2015-01-29 16:52:00 +01:00
600c9dd27d topics are deprecated 2015-01-29 15:45:04 +01:00
e380462532 topic for backwards compatibility 2015-01-29 15:36:13 +01:00
94e0e5ab7d Merge branch 'cpp' into cpp2
Conflicts:
	example/balance.html
2015-01-29 15:22:55 +01:00
8613382869 moved comment 2015-01-29 15:17:32 +01:00
df17c33898 event example 2015-01-29 15:05:43 +01:00
ddf17d93ac Samples and disams cmd for evm code 2015-01-29 14:46:59 +01:00
c8ee08c24b contract.js simplified 2015-01-29 13:32:32 +01:00
84adf77bf3 Added RPC "Call" for JS calls to contracts 2015-01-29 13:10:34 +01:00
f75dcc7f4c Added abi example 2015-01-29 13:10:04 +01:00
842b8cf323 event.js 2015-01-29 12:35:21 +01:00
b5918a1faa removed create 2015-01-29 12:06:47 +01:00
d0c6559204 Merge branch 'develop' into qt5.4 2015-01-29 12:02:45 +01:00
6d012f628b implement transact 2015-01-29 12:01:51 +01:00
726852e3d3 Remove old websocket implementation 2015-01-28 21:39:49 -06:00
83b385a290 Separate golang source dir from GOPATH dir 2015-01-28 21:28:32 -06:00
ec85458612 updated ethereum.js and moved to subfolder
* Previous subtree caused a lot of trouble
* Implemented sha3 in our shiny new http JSON RPC
2015-01-29 00:24:18 +01:00
73dcbf7ba2 Add 'cmd/mist/assets/ext/ethereum.js/' from commit '63d9c070ef7637a3d570a5a45ea931c1680ebc02'
git-subtree-dir: cmd/mist/assets/ext/ethereum.js
git-subtree-mainline: f80fe97763
git-subtree-split: 63d9c070ef
2015-01-28 23:33:24 +01:00
f80fe97763 removed old js yet again 2015-01-28 23:33:20 +01:00
cbf1d07073 default http rpc on 2015-01-28 23:23:33 +01:00
8284bef072 Merge branch 'develop' into qt5.4 2015-01-28 22:21:26 +01:00
fd5d061d49 Merge branch 'develop' into Gustav-Simonsson-key_store_and_accounts_integration 2015-01-28 21:50:10 +01:00
32fbc0d334 Merge branch 'develop' into qt5.4 2015-01-28 21:36:53 +01:00
1337a8dfb1 upped pv 2015-01-28 21:34:08 +01:00
3440a8a0bf changed lost key 2015-01-28 21:12:26 +01:00
5e891ea981 Merge branch 'key_store_and_accounts_integration' of https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-key_store_and_accounts_integration 2015-01-28 20:55:55 +01:00
adda54ac55 Added webengine initializer 2015-01-28 20:50:20 +01:00
cebb149f5c removed key while in the process of moving to the new key storage 2015-01-28 20:50:09 +01:00
e1c0862658 Fix for API. 2015-01-28 10:19:49 -08:00
21fd31dad8 Merge branch 'jsonrpc' of github.com:ethereum/go-ethereum into jsonrpc 2015-01-28 12:01:15 -06:00
957f80c623 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-01-28 18:37:04 +01:00
1c51e12c18 Merge branch 'jsonrpc' into qt5.4 2015-01-28 18:36:41 +01:00
872b249711 further cleaned up xeth interface 2015-01-28 18:36:23 +01:00
1146f25015 clean up of xeth 2015-01-28 18:25:50 +01:00
45e15f62f5 merge jsonrpc 2015-01-28 18:22:53 +01:00
7f638f0b2d moving to a better xeth 2015-01-28 18:14:28 +01:00
5a52e86546 Update go to latest version
Now using git instead of mercurial
2015-01-28 11:10:16 -06:00
a88f609b8a Use custom Send methods 2015-01-28 10:22:37 -06:00
61e8ae2f7b events init 2015-01-28 14:55:39 +01:00
b46e1ca97e Merge branch 'jsonrpc' of github.com-obscure:ethereum/go-ethereum into jsonrpc 2015-01-28 14:52:09 +01:00
fb7c03ff4d switched to obscuren/qml 2015-01-28 14:51:54 +01:00
2544d2c952 tests for abi.filters 2015-01-28 14:39:10 +01:00
ea7c2fc673 abi function type 2015-01-28 14:20:36 +01:00
9a11a94894 Updated assets & moved messages 2015-01-28 14:02:36 +01:00
cbf162ca64 Allow CORS * 2015-01-28 14:02:18 +01:00
85d20cd61b Added big numbers 2015-01-28 14:02:03 +01:00
94976d63ca Merge branch 'develop' into qt5.4 2015-01-28 10:58:56 +01:00
cb47a9e97f new ethereum.js 2015-01-28 10:58:43 +01:00
ad5894e486 removed old ethereum.js 2015-01-28 10:54:06 +01:00
63d9c070ef fixed incoming messages 2015-01-28 10:50:24 +01:00
f15d23b496 updated messages 2015-01-28 10:47:17 +01:00
4c5968097d Merge branch 'jsonrpc' into qt5.4 2015-01-28 10:29:29 +01:00
159c4d56cd Merge branch 'develop' into jsonrpc 2015-01-28 10:23:58 +01:00
f3e78c8f3c reworking messages => log 2015-01-28 10:23:18 +01:00
8d9752a557 Address pull request comments
* Use crypto.Sign instead of directly calling secp256k1 lib
* Rename UserAccount to Account and Addr to Address (for consistency)
* Change AccountManager.Sign to take ptr to Account instead of
  address byte array
* Simplify copying of Accounts in Accounts()
* PubkeyToAddress and GetEntropyCSPRNG now exported
2015-01-28 05:12:57 +01:00
1345a8c67c log error on console, if api returns an error 2015-01-28 00:07:03 +01:00
83fad0fb59 removed fromFixed, toFixed && offset from tests 2015-01-27 23:03:57 +01:00
e9d017ba08 Rename api var for clarity 2015-01-27 14:34:01 -06:00
d8c6168d11 Return a websocker.Handler of the function 2015-01-27 14:26:42 -06:00
dd3f38fe5b Rename transport to ws
Cleanup object naming for clarity
2015-01-27 14:16:34 -06:00
a38bca3438 Add wsport flag to Mist 2015-01-27 12:40:52 -06:00
5f50fe7a4a Update CLI to use new Websocket RPC
Use “wsport” flag to change default port
2015-01-27 12:29:08 -06:00
b8e7b8e2e1 New simplified Websocket transport
Uses rpc.EthereumApi abstraction
2015-01-27 12:29:08 -06:00
2f0166b945 Indicate port in startup log message 2015-01-27 12:29:08 -06:00
d790229a33 Move HTTP transport to sub package of RPC 2015-01-27 12:29:07 -06:00
8c99a87aa8 Merge branch 'chfast-pr/evmjit' into develop 2015-01-27 16:31:29 +01:00
fe14b0b82e Merge branch 'pr/evmjit' of https://github.com/chfast/go-ethereum into chfast-pr/evmjit 2015-01-27 16:30:38 +01:00
aa5b29e2f2 Implemented contract ABI 2015-01-27 16:19:21 +01:00
382726fde4 Merge branch 'key_store_and_accounts_integration' of https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-key_store_and_accounts_integration 2015-01-27 16:18:40 +01:00
c2cb2bef96 removed web3.eth.account, fixed #37 2015-01-27 16:02:42 +01:00
09f633596d fixed #23 2015-01-27 15:20:22 +01:00
42a25f2f26 evaluating solidity method input params 2015-01-27 14:31:50 +01:00
6d59047c5f contract method name 2015-01-27 14:14:02 +01:00
ad7c05778f getMethodWithName 2015-01-27 14:05:30 +01:00
f02368141f fixed contract example 2015-01-27 11:53:34 +01:00
649b9cc195 fixed natspec example 2015-01-27 09:40:31 +01:00
1f5a6f1341 Merge branch 'develop' into cpp
Conflicts:
	dist/ethereum.js.map
	dist/ethereum.min.js
2015-01-27 09:36:39 +01:00
da4c2d530d removed promise dependency, updated readme, fixed node.js version of lib 2015-01-27 00:54:21 +01:00
079c59b929 Update JitVm to new EVM JIT ABI (C interface) 2015-01-26 18:02:09 +01:00
5b701962dc upgraded version to 0.0.9 2015-01-26 16:47:05 +01:00
c595632b92 gulp 2015-01-26 16:45:35 +01:00
c5610398d5 Merge branch 'master' into sync
Conflicts:
	lib/websocket.js
2015-01-26 16:45:12 +01:00
a7f4448f34 Merge branch 'develop' into sync 2015-01-26 16:43:21 +01:00
7807a4f738 polling every second 2015-01-26 16:42:43 +01:00
e5d294df32 return null instead of undefined, if not provider is set 2015-01-26 16:41:00 +01:00
d0b6f3663b watches are calling callback with a single result object, not a full jsonrpc response 2015-01-26 16:22:40 +01:00
c71aff99db Update EVM JIT runtime data layout 2015-01-26 16:13:55 +01:00
5d33d5a7d9 Merge remote-tracking branch 'upstream/develop' into evmjit 2015-01-26 15:46:10 +01:00
512ffa2bf4 Add accounts package and refactor key stores
* Add initial UserAccount and AccountManager structs
* Add NewAccount, Sign and Accounts functions
* Refactor key stores to use key address as main identifier
  while keeping the UUID.
* Use key address as file/dir names instead of UUID
2015-01-26 04:30:17 +01:00
d223ac0379 Additional work on the JS stuff to make it more similar to Solidity. 2015-01-25 13:43:36 -08:00
113a3809ab Fix string outputs.
Auto collapse for < 2 returns.
2015-01-24 18:23:39 -08:00
fb34c6c7b9 Auto select call or transact depending on constness. 2015-01-24 18:09:35 -08:00
7869294a26 Fixes to ethereum.js and standard.js. 2015-01-24 17:42:49 -08:00
61a0158877 Vanity addresses in AZ.
Fixes to ethereum.js
eth.flush()
2015-01-24 16:46:46 -08:00
fa93480d9a added addressbook 2015-01-24 19:45:53 -05:00
063f69d51d added local 2015-01-24 19:32:26 -05:00
c54a85ee64 Reworking browser 2015-01-25 00:55:33 +01:00
48083608b5 Updated readme with badges 2015-01-24 19:09:29 +01:00
393a6c5edf Gitter link 2015-01-24 18:48:19 +01:00
0d96528d2f Skip for travis 2015-01-24 18:46:35 +01:00
2ba54a69be skipping for travis 2015-01-24 18:40:03 +01:00
94106cc41f JitVm code cleanups & refactoring. Some memory copies eliminated (i.e. in SHA3 calculation) 2015-01-23 16:45:22 +01:00
3aa0410f6e Merge remote-tracking branch 'upstream/develop' into pr/evmjit 2015-01-23 15:37:37 +01:00
7a894e3738 Merge branch 'develop' into jsonrpc 2015-01-23 14:29:01 +01:00
d792e95c21 Merge branch 'Gustav-Simonsson-import_presale_keys' into develop 2015-01-22 22:42:52 +01:00
a125b0fbc3 Merge branch 'import_presale_keys' of https://github.com/Gustav-Simonsson/go-ethereum into Gustav-Simonsson-import_presale_keys
Conflicts:
	crypto/crypto.go
2015-01-22 22:42:39 +01:00
a216225827 Merge branch 'pr/evmjit' of https://github.com/chfast/go-ethereum into chfast-pr/evmjit 2015-01-22 21:47:36 +01:00
0dfe511370 Use curve params instead of hardcoded 32 bytes 2015-01-22 18:15:11 +01:00
d4cc2d3503 Pad private key when signing & length check for hashes in sign 2015-01-22 18:12:05 +01:00
d5f38f5690 JitVM: the EVM JIT bridge 2015-01-22 18:00:15 +01:00
c01f0ae825 Merge commit 'b1971f46cce7d21be5f6277c9f8c406a0d195f78' into natspec 2015-01-22 17:57:53 +01:00
81bbe8c93b simplified synchronous polling 2015-01-22 17:57:26 +01:00
29fa57e9b3 natspec.js updated to use sync api 2015-01-22 15:38:48 +01:00
13f39afbdd Merge commit '93fa6855afad7a7eb86e49efe384372a6060da35' into natspec 2015-01-22 15:33:47 +01:00
3073511e30 not parsing transaction output 2015-01-22 15:32:52 +01:00
6c4432d417 Merge commit 'b32dedc5b54f853cf63bb2663c8bca6aa4272b0b' into natspec 2015-01-22 15:18:59 +01:00
e45db42e94 fixed contract.js 2015-01-22 15:18:21 +01:00
375ca542ab Merge commit '8e3ba3a4285cc7e902a018196b3849df56944dd0' into natspec 2015-01-22 14:38:04 +01:00
0202b05a5d implicit solidity method call 2015-01-22 14:37:34 +01:00
d6a92b18d4 fixed natspec example 2015-01-22 13:39:32 +01:00
5e623f14f3 Merge commit 'cdd7af2a6e87363d0ff7d2528f9d9b521bf2ef20' into natspec 2015-01-22 13:06:11 +01:00
22c77c607e qt sync provider 2015-01-22 13:04:28 +01:00
b777d6aa3f UI Updates
* Browser now has tabs
* Fixed a callback issue
2015-01-22 12:35:31 +01:00
4df2e1ef5c updated tests 2015-01-22 00:37:58 +01:00
67f9783e6a Moved obscuren secp256k1-go 2015-01-22 00:35:00 +01:00
6eaa404187 Moved sha3 from obscuren 2015-01-22 00:25:00 +01:00
0045ce4cde Future blocks not allowed 2015-01-22 00:24:30 +01:00
465b0a79d8 Updated browser & pass view to callback function 2015-01-22 00:24:20 +01:00
ad8e92e9c6 Merge commit 'eb4984c0d036c1420e782ca136810e851e33fb37' into natspec 2015-01-21 21:54:51 +01:00
edfb874527 changes in filter.js (not yet working) 2015-01-21 21:54:03 +01:00
c2d9c1a6f1 toDecimal/fromDecimal is using bignumber.js now 2015-01-21 21:35:15 +01:00
81a5813270 removed unused pieces of code 2015-01-21 21:24:40 +01:00
08e2696627 removed send queues from providermanager 2015-01-21 21:22:05 +01:00
c9693b4746 contract.html example is working with sync api 2015-01-21 21:12:07 +01:00
ceb4357a8d sync api tests running, removed unused pieces of code 2015-01-21 20:43:20 +01:00
fc986a3fbe removed unused providers 2015-01-21 20:30:32 +01:00
0d2cccc2ce http sync api 2015-01-21 20:29:02 +01:00
8af42d42da CamelCase aesCBCDecrypt 2015-01-21 19:08:05 +01:00
81ff253e68 Merge commit 'c4638ba3edbd14677da5441d61f7845668df2b22' into natspec 2015-01-21 18:58:33 +01:00
e68f8e79ea natspec changes 2015-01-21 18:58:13 +01:00
e1fcffcc81 gulp 2015-01-21 18:58:01 +01:00
f3e78e50ff changes to for natspec 2015-01-21 18:56:30 +01:00
c14900dbb0 Add initial P2P json logs 2015-01-21 11:47:21 -06:00
0aa76d3e5b Rename jsonlogger method 2015-01-21 11:45:30 -06:00
622bfd4f08 Check LogSystem type 2015-01-21 10:58:09 -06:00
1077109e11 Add JsonLogger type 2015-01-21 10:57:29 -06:00
ed7d7b405e Split file cleanup 2015-01-21 10:26:54 -06:00
41d80ba17b Add JsonLevel log level 2015-01-21 10:18:46 -06:00
bdf99e0981 Add LogFormat flag 2015-01-21 10:17:07 -06:00
acdc19d1b7 Add rawLogSystem 2015-01-21 10:16:15 -06:00
7f9c335487 Split into multiple files 2015-01-21 10:04:11 -06:00
1f8290ca44 Add ImportPreSaleKey
* ImportPreSaleKey takes a KeyStore, a presale key JSON (e.g. file content)
  and a password string. It stores the key in the given key store.
* Refactored common AES decryption and moved some functions to crypto.go
2015-01-21 16:35:43 +01:00
215780ab56 Move GetRequestReply to EthereumApi
Off of jsonWrapper
2015-01-20 13:58:51 -06:00
a6d4ce2630 Move argument types to separate file 2015-01-20 13:57:51 -06:00
0c77a96249 Move websockets out of cmd/util 2015-01-20 13:40:24 -06:00
d92fde6980 Merge branch 'develop' into jsonrpc 2015-01-20 13:22:38 -06:00
87f50659db fixed url bug in browser 2015-01-20 18:42:29 +01:00
689630d261 Merge commit '53b4fda16d0b191be8ab986379a328aa38aaf916' into natspec 2015-01-20 17:48:08 +01:00
848c54dc47 _currentAbi object 2015-01-20 17:46:37 +01:00
9845029a75 StdVm by default 2015-01-20 15:49:12 +01:00
375cc67ba6 Hide browser bar when coming from a DApp url 2015-01-20 15:48:38 +01:00
380c1522ac solidity methods "overloading" 2015-01-20 15:06:05 +01:00
4dd7be7ed0 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-01-20 15:04:30 +01:00
12fad65991 Merge pull request #259 from Gustav-Simonsson/develop
KeyStore (Low level key functionality)
2015-01-20 15:04:21 +01:00
5c79ee4446 fixed natspec_contract.html example 2015-01-20 09:22:32 +01:00
d48140cab3 Address pull request comments
* Further simplify "constructor" function's allocation of structs
* Fix formatting
2015-01-19 22:12:22 +01:00
3cf038f300 Address pull request comments
* Allocate with composite literal instead of new
* Remove check of number of bytes read from rand
2015-01-19 20:24:30 +01:00
83505e61f3 Merge commit '2b4d38b9bf059014596e1ab00c99dc2ad4ab3761' into ethereumjs 2015-01-19 13:53:44 +01:00
6a58db66f7 parsing real, ureal values on output 2015-01-19 13:22:58 +01:00
af54832d24 encoding real on input 2015-01-19 12:59:29 +01:00
86b417e83f fixes for autoprovider 2015-01-19 11:36:41 +01:00
f34838688e Minor browser improvements 2015-01-19 11:23:17 +01:00
bcb1166e52 Added 0 key proof error
Private key \x00\x00...\x00 returns the _exact_ same public key as \x11
\x11...\x11. Currently investigating.
2015-01-19 11:22:56 +01:00
8d1637f567 Moved connection errors to DebugDetail level 2015-01-19 11:21:46 +01:00
b03614527b VmDebug => StdVm 2015-01-19 11:20:55 +01:00
9b509f6478 Print error instead of returning for seed node err
Returning an error would indicate a complete failure initialising the
Ethereum backend. Instead we should print the message and continue.
2015-01-19 11:20:12 +01:00
89c69a1d25 VmDebug => StdVm 2015-01-19 11:18:34 +01:00
06bfe19f05 Merge pull request #260 from fjl/rlp-encoder
rlp: allow encoding non-empty interface values
2015-01-19 10:59:35 +01:00
7394ee7c72 Fixed difficulty
Difficulty was broken when refactored.
2015-01-18 15:45:54 +01:00
b2d23b91e7 Merge pull request #32 from kumavis/patch-1
WebsocketProvider - fixed incorrect variable name
2015-01-18 00:30:08 +01:00
2ce109eb53 Merge commit '6a383d6ed3fb37cf6739f6ac441652adfdb70463' into ethereumjs 2015-01-17 15:45:11 +01:00
823fb2995b tests for parsing output array 2015-01-17 13:50:07 +01:00
1e2c1ae98a output parser string support 2015-01-17 13:39:19 +01:00
b457e88cd0 support for int array types[] 2015-01-17 02:14:40 +01:00
e97478cc1e WebsocketProvider - fixed incorrect variable name 2015-01-16 16:03:13 -08:00
2d8383d3c8 removed unused functions 2015-01-16 23:55:32 +01:00
1c4d8f36e4 Merge commit '29333fc213b62b27ef826616cf77430947fb6eab' into ethereumjs 2015-01-16 16:49:50 +01:00
e94da808cb default padding set to 32, separated to one variable 2015-01-16 16:46:14 +01:00
a1c0bb68dd fixed checking first bit for parsing int output 2015-01-16 16:40:26 +01:00
774e9d24a1 abi.js rounds down floating point input 2015-01-16 16:26:58 +01:00
9a264a4284 updated bower.json && package.json version, added bignumber.js to bower dependencies 2015-01-16 16:04:41 +01:00
0172939490 fixed #28 and other small node.js issues 2015-01-16 15:49:36 +01:00
24613a60dc Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-01-16 14:51:47 +01:00
acc8f7fadc Add defer rescued back in 2015-01-16 14:51:38 +01:00
de4ea8e6f4 Merge commit 'd876522bc0614fea3180a54be57bcb61784b352e' into ethereumjs 2015-01-16 12:07:48 +01:00
2c36d5ff45 big integers on abi.js output, tests 2015-01-16 11:58:26 +01:00
f1295b506d tests for bigintegers on input 2015-01-16 11:28:46 +01:00
fbcc6d0d25 BigNumber support 2015-01-16 10:47:43 +01:00
fc92abec2c rlp: allow encoding non-empty interface values
This needs to be supported because []someInterface does occur sometimes.

Funny enough, the fix involves changes to the decoder. makeDecoder
cannot return an error for non-empty interfaces anymore because the type
cache builds both decoder and writer. Do the check at 'runtime' instead.
2015-01-15 23:35:26 +01:00
52bb149541 Merge pull request #257 from fjl/rlp-encoder
rlp: add functions for encoding
2015-01-15 22:28:48 +01:00
9caf32befe Update code comments 2015-01-15 19:58:38 +01:00
47d3b3dd58 Address pull request comments
* Remove flags field from key struct
* Change JSON struct fields from string to []byte
* Change GenerateNewKey API to take io.Reader for random source
* Remove mixing entropy source function
* Use testing Fatal in tests
2015-01-15 19:40:10 +01:00
a1c2749380 Address pull request comments
* Simplify scrypt constants with const block
* Add key store constructors and make their types private
* Simplify key store and file namings to be less Java Enterprise™
* Change test error logging to use t.Error(err)
* Reduce number of naked returns (just like my ex-gf)
* Simplify file reading path code
2015-01-15 19:40:10 +01:00
945798f913 Add new key_store interface and two new key stores
* Add new generic key_store interface
* Add new plaintext key store storing unprotected keys on disk
* Add new encrypted key store storing encrypted keys on disk
* Add new entropy mixing function using OS and go runtime sources
2015-01-15 19:40:10 +01:00
6d02c0d392 Merge commit '1a6dbeff6e86d65cae6d7db366cbaa4182eaff7f' into ethereumjs
Conflicts:
	libjsqrc/ethereumjs/dist/ethereum.js
	libjsqrc/ethereumjs/dist/ethereum.js.map
	libjsqrc/ethereumjs/dist/ethereum.min.js
	libjsqrc/ethereumjs/lib/abi.js
2015-01-15 17:27:07 +01:00
ec74fc05d4 gulp 2015-01-15 16:01:58 +01:00
46b932ccc0 negative integers support 2015-01-15 15:51:25 +01:00
f85f77f6cc fixed typos 2015-01-15 14:37:18 +01:00
6a4b4f3449 fixed readme 2015-01-15 14:30:34 +01:00
d0473d6d83 gulp 2015-01-15 11:40:04 +01:00
70bf1a5711 fixed typos 2015-01-15 11:39:02 +01:00
bacc5aa6d3 methodExists and propertyExists are now separated tests 2015-01-15 11:38:21 +01:00
29c46cdf34 rlp: fix Decode benchmarks 2015-01-15 11:12:39 +01:00
552f5b2693 rlp: add functions for encoding
I'm reasonably confident that the encoding matches the output of
ethutil.Encode for values that it supports. Some of the tests have been
adpated from the Ethereum testing repository.

There are still TODOs in the code.
2015-01-15 11:00:19 +01:00
d5d9746ca3 updated tests 2015-01-15 10:46:42 +01:00
508f116738 Merge pull request #798 from LefterisJP/natspec_OnContractCreation
Natspec Popup Authentication on transaction
2015-01-15 01:37:52 +01:00
472ad43211 more comments 2015-01-14 20:36:26 +01:00
603c790213 next part of abi.js parsers tests and fixes 2015-01-14 20:29:20 +01:00
62e0e18030 Changed public whisper api not to reveal temporary private keys 2015-01-14 18:12:18 +01:00
b0a9bbf33a next part of abi.js docs 2015-01-14 14:19:54 +01:00
6b2ec23132 formatting bool tests and fixes 2015-01-14 14:06:29 +01:00
ed1cb9edca simplifid abi.js methods 2015-01-14 13:53:40 +01:00
17f2f12ce6 gulp 2015-01-14 12:01:24 +01:00
12bdb5f550 providers documentation 2015-01-14 12:01:11 +01:00
8d1f96cc0a few comments 2015-01-14 10:50:34 +01:00
a4049fb85c Cleaned up some unused functions 2015-01-14 09:28:52 +01:00
bb55307a9d Updated tests 2015-01-13 20:31:31 +01:00
422dc05bb0 ProviderManager separated to providermanager.js file 2015-01-13 18:40:01 +01:00
9a8f45ee30 Filter separated to filter.js file 2015-01-13 18:28:49 +01:00
dac93ed616 Natspechandler: Get function hash from transaction data 2015-01-13 17:54:09 +01:00
8b7d4b0c9e beginning of comments in web3 2015-01-13 17:05:05 +01:00
499bc404e8 Stub missing UnmarshalJSON methods 2015-01-13 09:37:30 -06:00
a81d835e4d cleanup 2015-01-13 09:37:08 -06:00
961e4da7d8 Add support for CodeAt 2015-01-13 09:27:36 -06:00
b178414a47 Added license headers 2015-01-13 09:13:43 -06:00
f54c90a0ba A first version of Natspec warning popup
- Runtime Contract code hash can now be retrieved from the Compiler

- Using the hash the Natspec handler stores and later retrieves Natspec
  JSON for a given contract.
2015-01-13 15:59:42 +01:00
ee167e53d1 test for parsing multiple methods description 2015-01-13 15:42:56 +01:00
8f733461b3 Default datadir for mist is now shared with CLI (.ethereum) 2015-01-13 14:58:12 +01:00
82beaabf6a Fixed consensus issue 2015-01-13 14:57:51 +01:00
4056c046a7 tests... 2015-01-13 13:47:31 +01:00
e3cad04dec Fixed whisper messages
* Whisper protocol wasn't properly suppling envelope slices
* Message history wasn't properly propagated
* Added 'Messages' method, filtering any current envelope with the
  supplied filter.
2015-01-13 13:36:44 +01:00
1428dcee21 web3.contract -> web3.eth.contract 2015-01-13 13:03:40 +01:00
f3b71a73e3 removed unused line 2015-01-13 12:51:23 +01:00
380d9862c3 tests in progress, fixed utf characters conversion in toAscii 2015-01-13 12:49:10 +01:00
b6c0e53d69 Auto-generated commits, too. 2015-01-13 11:06:43 +00:00
e95bb34ea0 Fix for JS API formatting. 2015-01-13 11:04:31 +00:00
9e0de57a82 mocha test reporter 2015-01-13 11:29:19 +01:00
f6ff1f18b8 mocha reporter name starts with lower case letter 2015-01-13 11:21:58 +01:00
7595a5dfcb removed padding calculation from ethereum.js, padding is always 32 2015-01-13 11:15:44 +01:00
1e5353824a updated tests 2015-01-13 10:32:02 +01:00
4704a0a288 remove pre compiled for tests 2015-01-13 10:30:52 +01:00
b2112729fa cleanup 2015-01-12 23:44:56 -06:00
32bed50ba1 begin conversion to rpc over http
Per specification at
https://github.com/ethereum/wiki/wiki/Generic-JSON-RPC
2015-01-12 23:25:29 -06:00
5b561f434d Merge pull request #254 from chfast/pr/jitvm_stub
JitVm struct stub. Forwards calls to DebugVm.
2015-01-13 00:29:41 +01:00
750d70c202 updated tests 2015-01-13 00:25:45 +01:00
34689cb3f3 Added manual triggering of filters 2015-01-12 20:36:45 +01:00
ba225017c4 JitVm struct stub. Forwards calls to DebugVm. 2015-01-12 19:40:14 +01:00
507241f73c shh getMessage => getMessages 2015-01-12 18:34:37 +01:00
8a1b51c716 updated tests 2015-01-12 16:13:30 +01:00
75cd9cd2de updated tests 2015-01-12 14:40:40 +01:00
00348756bc updated tests 2015-01-12 13:49:47 +01:00
35fe4313d5 pre-pow 2015-01-12 10:19:27 +01:00
9a9987aeed Merge commit 'a1023a5dffee7c06e8b75a21f5c9b8826e820942' into develop
Conflicts:
	libjsqrc/ethereumjs/dist/ethereum.js.map
2015-01-11 18:18:05 +01:00
5582901ca5 Various fixes to ethereum.js and client web API stuff. 2015-01-11 18:15:35 +01:00
ded221fba2 Merge commit 'ab745d3b0eb89d67db1ed953020c665be3d072ed' into develop
Conflicts:
	libjsqrc/ethereumjs/.travis.yml
	libjsqrc/ethereumjs/README.md
	libjsqrc/ethereumjs/dist/ethereum.js
	libjsqrc/ethereumjs/dist/ethereum.js.map
	libjsqrc/ethereumjs/lib/abi.js
	libjsqrc/ethereumjs/package.json
2015-01-11 17:54:36 +01:00
ab745d3b0e updated readme 2015-01-11 17:23:03 +01:00
b915c7a870 updated readme 2015-01-11 17:13:32 +01:00
6c26255979 Merge branch 'tests' into develop 2015-01-11 17:12:37 +01:00
e2c4525da7 Merge branch 'master' into develop 2015-01-11 17:12:29 +01:00
e778e127d6 spec reporter instead of nyan 2015-01-11 17:04:30 +01:00
a4e6f0b3c6 fixed travis.yml && added nmp test script 2015-01-11 16:40:09 +01:00
048e7771fb Merge branch 'master' into tests 2015-01-11 16:36:38 +01:00
15c229300c updated package json 2015-01-11 16:36:07 +01:00
24814a4f0f Merge branch 'master' of https://github.com/ethereum/ethereum.js 2015-01-11 16:33:08 +01:00
6188e64473 Update README.md 2015-01-11 16:25:41 +01:00
c34b0c67a1 Update README.md 2015-01-11 16:23:06 +01:00
7e6b72cb5c removed accidental qt dep 2015-01-10 18:09:57 +01:00
e3da85faed Implemented filter for ws + fixes
* proper 0xhex
* filters fixed
* start of filter manager
* accounts for ws. Closes #246
2015-01-10 00:51:56 +01:00
491c23a728 Moved the TD method from block processor. 2015-01-09 22:42:36 +01:00
351516c57c Cast to string for hashable type 2015-01-09 22:23:33 +01:00
8c7b764d47 updated tests 2015-01-09 21:18:34 +01:00
905b8cc82f mem fixes for vm. Changed uncle inclusion tests 2015-01-09 17:38:35 +01:00
47687cf085 default padding changed to 0 2015-01-09 17:27:56 +01:00
29c60c000a Merge branch 'develop' into tests 2015-01-09 16:48:44 +01:00
35f4bb96f3 Limit hashes. Closes #249 2015-01-09 16:44:09 +01:00
92f171ec99 rerun gulp 2015-01-09 16:40:55 +01:00
0933a79ab8 missing fromAscii 2015-01-09 16:38:26 +01:00
b136b387a7 Merge branch 'ethersphere-develop' into develop 2015-01-09 16:34:49 +01:00
6eb455032c recover 2015-01-09 15:32:14 +01:00
5c8c0ae04e Fixed size 0 bug 2015-01-09 15:30:46 +01:00
a35be3a12a Merge branch 'develop' of https://github.com/ethersphere/go-ethereum into ethersphere-develop 2015-01-09 13:37:15 +01:00
f9b0d1a8e7 Updated to new ethereum.js api 2015-01-09 13:36:47 +01:00
543a87c63f method signature length defined 2015-01-09 13:30:14 +01:00
c9f566269b merged 2015-01-09 13:28:48 +01:00
bfa12d75f8 new switch 2015-01-09 13:26:49 +01:00
b3eda29f41 Merge branch 'master' into tests 2015-01-09 13:07:34 +01:00
18d8bf4b9c updated ethereum.js 2015-01-09 13:01:21 +01:00
aee82d3196 removed 2015-01-09 13:00:37 +01:00
a5907a8239 Merge branch 'master' of https://github.com/ethereum/ethereum.js 2015-01-09 12:57:03 +01:00
2a6c84984a version upgraded 2015-01-09 12:55:46 +01:00
0538c11576 sha3 method signature 2015-01-09 12:55:04 +01:00
012a1c2533 Updated ethereum.js 2015-01-09 12:45:09 +01:00
c9015e2e04 module var fix 2015-01-09 12:44:11 +01:00
07fba274b1 module var fix 2015-01-09 12:43:45 +01:00
585f259b63 Support input from args 2015-01-09 12:04:54 +01:00
b3161f5803 Merge remote-tracking branch 'upstream/develop' into develop 2015-01-09 06:21:47 +00:00
5a9952c7b4 major blockpool change
- the spec says response to getBlockHashes(from, max) should return all hashes starting from PARENT of from. This required major changes and results in much hackier code.
- Introduced a first round block request after peer introduces with current head, so that hashes can be linked to the head
- peerInfo records currentBlockHash, currentBlock, parentHash and headSection
- AddBlockHashes checks header section and creates the top node from the peerInfo of the best peer
- AddBlock checks peerInfo and updates the block there rather than in a node
- request further hashes once a section is created but then no more until the root block is found (so that we know when to stop asking)
- in processSection, when root node is checked and receives a block, we need to check if the section has a parent known to blockchain or blockPool
- when peers are switched, new peer launches a new requestHeadSection loop or activates its actual head section, i.e., the section for it currentBlockHash
- all tests pass
2015-01-09 06:03:45 +00:00
8ecc9509b3 add ErrInsufficientChainInfo error 2015-01-09 06:03:32 +00:00
f72cb28b0f adapt unit tests to spec
- AddBlockHashes ignores the first hash (just used to match getBlockHashes query) sends the rest as blocksMsg
- new test TestPeerWithKnownParentBlock
- new test TestChainConnectingWithParentHash
- adapt all other tests to the new scheme
2015-01-09 05:57:09 +00:00
43ed0ed1ae no need to call AddBlockHashes when receiving new block 2015-01-09 05:06:04 +00:00
69dfca2feb minor changes in integration tests 2015-01-09 05:04:32 +00:00
3bdf28c1fe GetBlockHashesFromHash(hash, max) gives back max hashes starting from PARENT of hash 2015-01-09 05:03:26 +00:00
c8a4c04b36 err 2015-01-08 23:15:46 +01:00
26f066f0c7 just enable by default 2015-01-08 22:18:23 +01:00
4a0ade4788 Fixed some whisper issues 2015-01-08 21:41:32 +01:00
c397e350f4 mocha opts file && init of parser tests 2015-01-08 20:24:30 +01:00
b6058a837f methods existance tests in progress 2015-01-08 19:59:03 +01:00
5518022a5d mocha test init 2015-01-08 19:35:32 +01:00
5f958a582d fixed other tests to use hashes as well 2015-01-08 16:48:39 +01:00
e27237a03a Changed to use hash for comparison
DeepReflect would fail on TD since TD isn't included in the original
block and thus the test would fail.
2015-01-08 16:45:51 +01:00
ee84b20247 Reworking GUI interaction. Fixed javascript inject. Closes #132 2015-01-08 16:38:24 +01:00
b25126a277 Minor fixed and additions for block proc
* Path check length
* Genesis include TD
* Output TD on last block
2015-01-08 16:37:06 +01:00
807ec60e63 missing jshint ignore 2015-01-08 15:43:22 +01:00
f9cc090473 fixed example 2015-01-08 15:31:46 +01:00
2f3384947b version upgrade 2015-01-08 15:13:43 +01:00
a8dde17146 fixes for node.js 2015-01-08 15:11:20 +01:00
db4aaedcbd Moved ptrie => trie. Removed old trie 2015-01-08 11:47:04 +01:00
5208bb32f1 gulpfile modifications, default build set to dev 2015-01-07 14:13:29 +01:00
982c812e81 Read directly from stdin 2015-01-07 13:38:28 +01:00
c1908c7d91 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2015-01-07 13:22:29 +01:00
59c5a2f519 Merge pull request #244 from fjl/license-tool
Generated License Headers
2015-01-07 13:22:22 +01:00
1d05027ba2 a few fixes for the license tool 2015-01-07 13:17:50 +01:00
fed3e6a808 Refactored ethutil.Config.Db out 2015-01-07 13:17:48 +01:00
ec7cb9981c add license tool and initial mailmap 2015-01-07 12:56:46 +01:00
df4d7846e5 Merge pull request #22 from debris/strings
strings, real, ureal paddings and implicit paddings for uint, int and hash
2015-01-07 11:16:46 +01:00
6c160adab3 Merge pull request #21 from debris/master
fixed gulp build
2015-01-07 11:16:27 +01:00
032ab66529 Added version flag 2015-01-07 01:21:55 +01:00
60d9611c23 Fixed tests where txs weren't properly removed 2015-01-07 01:21:45 +01:00
210682b734 real, ureal paddings and implicit paddings for uint, int and hash 2015-01-06 21:50:09 +01:00
f0ec751237 Updated tests 2015-01-06 20:22:31 +01:00
1d139f7a0b solidity string support 2015-01-06 18:29:38 +01:00
25e6c4eff8 Adjusted difficulty and skip get tx messages 2015-01-06 14:02:47 +01:00
a76b7dadae Don't auto push jeff ... 2015-01-06 13:39:01 +01:00
b6232cfdd1 fixed tabs 2015-01-06 13:37:02 +01:00
a2a77172a6 bring back todos 2015-01-06 13:32:04 +01:00
1b903767e0 Fixed port num 2015-01-06 13:31:52 +01:00
4e7f53adf0 Changed to poc-8 & removed GetTxs 2015-01-06 13:31:08 +01:00
8c1b26889a renamed example/index.html -> example/balance.html 2015-01-06 13:27:43 +01:00
af9242f4cc fixed gulp build 2015-01-06 13:26:51 +01:00
564f02aa2b Fixed tests 2015-01-06 13:18:09 +01:00
3b8725e0f5 Merge pull request #239 from fjl/grab-bag
Grab bag of fixes
2015-01-06 13:13:16 +01:00
3caa4ad1ba p2p: improve test for peers message
The test now checks that the number of of addresses is correct
and terminates cleanly.
2015-01-06 12:23:38 +01:00
b0ff946b55 p2p: move peerList back into baseProtocol
It had been moved to Peer, probably for debugging.
2015-01-06 12:23:38 +01:00
eb0e7b1b81 eth, p2p: remove EncodeMsg from p2p.MsgWriter
...and make it a top-level function instead.

The original idea behind having EncodeMsg in the interface was that
implementations might be able to encode RLP data to their underlying
writer directly instead of buffering the encoded data. The encoder
will buffer anyway, so that doesn't matter anymore.

Given the recent problems with EncodeMsg (copy-pasted implementation
bug) I'd rather implement once, correctly.
2015-01-06 12:23:38 +01:00
36e1e5f151 cmd/peerserver: add some command line switches 2015-01-06 12:23:37 +01:00
4c8c115a76 cmd/peerserver: use NoDial, don't use seed peers 2015-01-06 12:23:37 +01:00
545e14691b cmd/peerserver: fix for new client identity type 2015-01-06 12:23:37 +01:00
be97785856 cmd/evm: add dummy implementation for GetHash
Fixes the build. AFAIK evm does not bother keeping a chain and
cannot provide a real implementation.
2015-01-06 12:23:37 +01:00
fde0ddb324 cmd/rlpdump: remove stray return 2015-01-06 12:23:36 +01:00
117f66e823 Added license headers 2015-01-06 12:13:57 +01:00
a26aecdfdb Updated WS API. Fixes #219. Closes #220 2015-01-06 11:44:22 +01:00
47e6b2cef8 Allow extra to be set for mined blocks 2015-01-06 00:19:07 +01:00
cc7f8f58e8 Limit block extra to 1024 2015-01-06 00:17:05 +01:00
c9985bf563 Fixed peer window. Minor tweaks and fixes 2015-01-05 19:53:53 +01:00
22c0c5465a Merge pull request #235 from fjl/rlpdump
fixes for rlpdump
2015-01-05 17:48:04 +01:00
2cfbf76db8 Merge pull request #233 from fjl/rlpdump
cmd/rlpdump: new helper command
2015-01-05 17:42:52 +01:00
ec4dee0fcd cmd/rlpdump: remove extra buffer 2015-01-05 17:42:20 +01:00
952287db29 Updated tests 2015-01-05 17:40:23 +01:00
b99b2c446c Precompiled contract & Depth change
* Added pre-compiled contract 0x04 (mem cpy)
* Changed depth error to return the gas instead of consuming
2015-01-05 17:39:42 +01:00
04c0f7e15c cmd/rlpdump: add license header and synopsis 2015-01-05 17:38:39 +01:00
d001479a47 unclean shutdown for now 2015-01-05 17:15:25 +01:00
f16810c48e added shh back in 2015-01-05 17:12:52 +01:00
66b05433b6 Merge branch 'ethersphere-eth.blockpool' into poc8 2015-01-05 17:12:19 +01:00
6abf8ef78f Merge 2015-01-05 17:10:42 +01:00
b907a5d765 cmd/rlpdump: new helper command 2015-01-05 13:45:38 +01:00
b0854fbff5 BlockManager => BlockProcessor 2015-01-05 11:22:02 +01:00
c1dee15144 BlockManager => BlockProcessor 2015-01-05 00:18:44 +01:00
987119cd4a Merge branch 'poc8' into docbranch 2015-01-04 14:39:15 +01:00
08b03afa4b Version bump 2015-01-04 14:34:04 +01:00
09841b1c9b Cleaned up some of that util 2015-01-04 14:20:16 +01:00
bd0c267cbe Cleanup old code 2015-01-03 17:29:08 +01:00
ca1b2a1a91 Changed prev_hash to block_hash, state transition now uses vm env
* PREVHASH => BLOCKHASH( N )
* State transition object uses VMEnv as it's query interface
* Updated vm.Enviroment has GetHash( n ) for BLOCKHASH instruction
* Added GetHash to xeth, core, utils & test environments
2015-01-03 17:18:43 +01:00
1b90567546 Merge branch 'docbranch' of github.com-obscure:ethereum/go-ethereum into docbranch 2015-01-03 12:41:19 +01:00
16f417f5af Fixed bug where logging could crash client during tx adding 2015-01-02 22:19:58 +01:00
5c82fdc243 Make sure that the object exists 2015-01-02 22:18:23 +01:00
55e55826ee Changed JUMP(I) behaviour.
* All jumps must land on a JUMPDEST instruction byte.
* The byte may not be part of a PUSH*
2015-01-02 17:35:55 +01:00
530953050a Updated protocol version 2015-01-02 17:35:00 +01:00
24f89f8bd9 Squashed commit of the following:
commit 2e75a216c7
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Jan 2 17:05:20 2015 +0100

    new jumpdest interpretation

commit 7aab71f656
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Jan 2 16:55:59 2015 +0100

    added complete exp tests

commit 3340f4dbfc
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Jan 2 14:26:55 2015 +0100

    retuning gas prices of recursive bombs to test limits

commit 456b5791bb
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Jan 2 14:08:55 2015 +0100

    more init code, systemoperations and transaction tests

commit 1f5552feb4
Author: wanderer <mjbecze@gmail.com>
Date:   Mon Dec 29 20:11:41 2014 -0500

    added balance tests

commit 4d37c1cea2
Author: wanderer <mjbecze@gmail.com>
Date:   Sat Dec 27 20:30:42 2014 -0500

    added trie tests for branches on
    detel

commit 2fdc7bfbd1
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Sat Dec 27 22:46:21 2014 +0100

    more random tests

commit 98fe404e6a
Merge: aafb5f7 8c34e93
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Tue Dec 23 16:36:13 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit aafb5f768b
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Tue Dec 23 16:35:35 2014 +0100

    first failing random tests

commit 8c34e93b51
Author: wanderer <mjbecze@gmail.com>
Date:   Tue Dec 23 10:01:20 2014 -0500

    added stackOverFlow test to initCode

commit 8a285d258a
Merge: a4ccc6e 6567f9d
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Sat Dec 20 13:08:18 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit a4ccc6e72e
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Sat Dec 20 13:07:54 2014 +0100

    CALLCODE <-> RETURN

commit 6567f9d0b2
Author: wanderer <mjbecze@gmail.com>
Date:   Thu Dec 18 23:39:30 2014 -0500

    add refund tests

commit 07cfec33f8
Author: wanderer <mjbecze@gmail.com>
Date:   Thu Dec 18 18:30:46 2014 -0500

    added trieTest anyorder

commit 86c3b8cfad
Merge: b227b10 71b5d6e
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 18 21:43:06 2014 +0100

    Merge branch 'develop' of https://github.com/ethereum/tests into develop

commit b227b10f5d
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 18 21:42:41 2014 +0100

    more refund tests

commit 71b5d6e0a3
Author: wanderer <mjbecze@gmail.com>
Date:   Thu Dec 18 12:13:55 2014 -0500

    updated index.js

commit aefcb9716e
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 18 09:31:43 2014 +0100

    transaction tests and refund tests

commit ccbf120c36
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Sat Dec 13 23:03:21 2014 +0100

    added stInitCodeTest.json

commit cbf5afdef8
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Dec 12 22:03:54 2014 +0100

    update recursive create

commit a70c4b51a4
Author: Gav Wood <i@gavwood.com>
Date:   Fri Dec 12 17:22:41 2014 +0100

    Fix return tests.

commit f146467607
Author: Gav Wood <i@gavwood.com>
Date:   Fri Dec 12 16:33:51 2014 +0100

    Add test file.

commit c2bd8d1d7a
Author: Gav Wood <i@gavwood.com>
Date:   Fri Dec 12 14:27:38 2014 +0100

    Alter "" to null.

commit ce6344b770
Author: Gav Wood <i@gavwood.com>
Date:   Fri Dec 12 14:22:19 2014 +0100

    Trie testing.

commit 779f25d36c
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 11 22:59:56 2014 +0100

    first random test

commit 68175386c0
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 11 21:34:50 2014 +0100

    update gas prices

commit ad322fbb58
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 8 06:01:17 2014 +0100

    Log as array

commit f989f42618
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Dec 5 15:12:12 2014 +0100

    state log tests

commit 4bc65d1129
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 4 18:18:49 2014 +0100

    add calldataload, codecopy, extcodecopy tests

commit 12cfae18e3
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 4 15:57:56 2014 +0100

    add calldataload test

commit 086caf3701
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Wed Dec 3 08:31:03 2014 +0100

    protocol update (CALLCODE <-> RETURN), topics in log are arrays not sets

commit e6c92673b9
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 21:14:08 2014 +0100

    update state tests with logs

commit 4089b809fb
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 18:19:40 2014 +0100

    update gas costs

commit cfdca62277
Merge: 2e5175e f59f89d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 18:04:51 2014 +0100

    Merge pull request #42 from negedzuregal/fix

    vmTest fix

commit f59f89d876
Author: alon muroch <alonmuroch@gmail.com>
Date:   Mon Dec 1 16:18:12 2014 +0100

    vmEnvironmentalInfoTest CALLDATACOPY, CODECOPY, EXTCODECOPY fix

commit 68da13fe3e
Author: alon muroch <alonmuroch@gmail.com>
Date:   Mon Dec 1 11:10:57 2014 +0100

    vmArithmeticTest exp fix

commit 2e5175e818
Author: ethers <ethereum@outlook.com>
Date:   Sun Nov 30 19:55:51 2014 +0100

    add vmLogTest

commit b5b9408e64
Author: Heiko Heiko <heiko@heiko.org>
Date:   Sun Nov 30 16:27:27 2014 +0100

    updated genesis to new header w/o min_gas_price

commit 8e69fbfa98
Author: ethers <ethereum@outlook.com>
Date:   Fri Nov 21 17:42:05 2014 -0800

    add special tests

commit 90f4f942e6
Author: ethers <ethereum@outlook.com>
Date:   Thu Nov 20 19:01:09 2014 -0800

    typo

commit c5e5228e0d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 20 17:04:06 2014 +0100

    Removed log,post,out,gas,callcreates if exception occured

commit 9c0232a2b9
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 18:19:05 2014 +0100

    MakeMoney test

commit 3ba0007e86
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 16:23:04 2014 +0100

    Added log sections in all vmtests + log tests

commit d84be4fe07
Merge: c8497ab 76d2542
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 10:00:24 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit c8497ab257
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 10:00:02 2014 +0100

    new push32 test and renaming

commit 76d25420e1
Author: ethers <ethereum@outlook.com>
Date:   Mon Nov 17 18:59:30 2014 -0800

    adding test

commit 0be275e757
Merge: 1d42d1d d90868c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 22:47:34 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 1d42d1d7c6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 22:46:51 2014 +0100

    fix ecrecover2

commit d90868c307
Merge: 1f38c8c 6dbcf6b
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 20:26:59 2014 +0100

    Merge pull request #39 from wanderer/develop

    added test for max call depth on creation

commit 6dbcf6b0d6
Author: wanderer <mjbecze@gmail.com>
Date:   Mon Nov 17 14:06:43 2014 -0500

    spelling fix

commit 6fc07a7f81
Author: wanderer <mjbecze@gmail.com>
Date:   Sat Nov 15 21:39:16 2014 -0500

    added test for max call depth on creation

commit 1f38c8c0a2
Merge: 279b284 cd85ca1
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 20:10:21 2014 -0500

    Merge pull request #38 from wanderer/develop

    updated test  'jeff' in trietest.json

commit cd85ca17ed
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 19:59:34 2014 -0500

    Update trietest.json

commit 279b284c0d
Merge: 89675a7 6cae937
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 17:43:49 2014 -0500

    Merge pull request #37 from wanderer/develop

    Update trietest.json

commit 6cae937e5e
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 17:20:03 2014 -0500

    Update trietest.json

    'emptyValues' should have the same root as 'puppy'

commit 89675a7153
Merge: f1de1cc 32f0c47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 23:17:49 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit f1de1cc97a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 23:17:13 2014 +0100

    Fix CallRecursiveBomb2

commit 32f0c47c68
Merge: ab50e76 3da90d0
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Thu Nov 13 15:26:49 2014 -0500

    Merge pull request #36 from wanderer/develop

    converted back to arrary format

commit ab50e76652
Merge: d06b792 78f1e4a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 07:52:35 2014 +0100

    Merge pull request #35 from ethers/delOld

    rename tests since they are valid opcodes that exist

commit 3da90d01f6
Author: wanderer <mjbecze@gmail.com>
Date:   Wed Nov 12 22:22:47 2014 -0500

    converted back to arrary format

commit 78f1e4a945
Author: ethers <ethereum@outlook.com>
Date:   Wed Nov 12 19:11:06 2014 -0800

    rename tests since they are valid opcodes that exist

commit d06b792cd0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 12 07:00:17 2014 +0100

    minor change in CallSha256_1_nonzeroValue test

commit d434ecdcc3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 12 06:56:31 2014 +0100

    Added CallSha256_1_nonzeroValue test

commit 2c06f34cc0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 18:10:26 2014 +0100

    Store return value of call to precompiled contracts

commit 4b0c3b29ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 17:51:14 2014 +0100

    Fix gas cost for OOG calls

commit 63bcca7604
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue Nov 11 08:59:19 2014 +0100

    fix: genesis test

commit 6e0310c1ea
Merge: 30c266c 2927763
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 08:34:36 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 30c266caff
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 08:33:59 2014 +0100

    jump to position outside code stops execution

commit 2927763d68
Author: ethers <ethereum@outlook.com>
Date:   Mon Nov 10 14:10:22 2014 -0800

    RandomTests were removed

commit a0fa91b2b8
Merge: 6092484 fcba866
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 10 22:22:05 2014 +0100

    Merge branch 'develop' of https://github.com/ethereum/tests into develop

commit 60924843f0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 10 22:21:37 2014 +0100

    Unintended Exceptions work like OOG

commit fcba866721
Author: ethers <TODO>
Date:   Thu Nov 6 14:19:59 2014 -0800

    add StateTests

commit a441074ba4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 17:54:36 2014 +0100

    Updated precompiled contracts test

commit 0afa72c82b
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 15:27:45 2014 +0100

    Added precompiledContracts tests

commit 6be83dd5a1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 13:31:34 2014 +0100

    Update gas cost for PoC7

commit c18b8ab2d3
Merge: 66c2e1f 9a93258
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 09:19:53 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 66c2e1f642
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 09:19:22 2014 +0100

    Updated SIGNEXTEND tests

commit 9a9325822e
Author: ethers <TODO>
Date:   Wed Nov 5 16:20:26 2014 -0800

    part of 9b4e768 - Delete vmNamecoin.json

commit e229374f46
Merge: 189527e 9b4e768
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:59:49 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 189527e563
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:59:20 2014 +0100

    added dynamic jump out of code

commit 9b4e768995
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:41:54 2014 +0100

    Delete vmNamecoin.json

commit 4669b5694b
Merge: a567fed aaba185
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 15:00:12 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit a567fedaa7
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 14:59:08 2014 +0100

    added state systemOperationsTest

commit aaba185ceb
Merge: 79d7cbf fa782ae
Author: ethers <ethereum@outlook.com>
Date:   Tue Nov 4 12:15:40 2014 -0800

    Merge pull request #32 from ethers/indexjs

    updates needed per restructure

commit fa782aed93
Author: ethers <TODO>
Date:   Tue Nov 4 11:28:56 2014 -0800

    updates needed per restructure

commit 79d7cbfc4a
Merge: 9120274 1c1ba8d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:32:11 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 9120274a46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:31:27 2014 +0100

    Update tests to latest protocol changes (PoC7)

commit 1c1ba8d161
Merge: 014d370 3aebe53
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:30:52 2014 +0100

    Merge pull request #31 from CJentzsch/develop

    Restructered tests in folders in accordance to test suites

commit 3aebe532e5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:58:21 2014 +0100

    Updated vmNamecoin.json to new sstore prices

commit 8a0be21839
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:53:00 2014 +0100

    Added example state test

commit 83643addbc
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:36:25 2014 +0100

    removed systemoperationstests

commit 3930ca3a9a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:22:15 2014 +0100

    Restructered tests in folders in accordance to test suites

commit 014d370b5d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 21:23:56 2014 +0100

    New SIGNEXTEND tets

commit 155d449be2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 20:59:05 2014 +0100

    New tests for BNOT and SIGNEXTEND

commit c9eae764b8
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 28 12:58:27 2014 +0100

    Update SSTORE gas cost and BNOT instead of NEG

commit ad2a75ac58
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 16:05:49 2014 +0200

    Added new recursive bombs

commit 834c52af64
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 12:01:05 2014 +0200

    Changing gas cost to zero at stackunderflow

commit c73a8a89d2
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed Oct 22 13:04:45 2014 +0200

    Reverted back to original value.

commit b9a8c92422
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Tue Oct 21 17:02:52 2014 -0400

    fix spelling error

commit b48ae74af4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:26:26 2014 +0200

    Added failing random tests

commit bee0a4100c
Merge: 5050d20 b315da6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:15:05 2014 +0200

    Merge remote-tracking branch 'origin/master' into develop

commit 5050d20b4d
Merge: 7516685 ba35362
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 20 20:18:20 2014 +0200

    Merge pull request #26 from wanderer/develop

    Add a package.json for node.js

commit ba35362876
Author: wanderer <mjbecze@gmail.com>
Date:   Sun Oct 19 23:59:47 2014 -0400

    turned tests into a node module

commit 751668571e
Author: ethers <ethereum@outlook.com>
Date:   Thu Oct 16 17:08:20 2014 -0700

    json was invalid and missing quotes

commit 0e687cee47
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu Oct 16 17:13:24 2014 +0200

    Update vmEnvironmentalInfoTest.json

commit 78a78e2e6c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 15 14:19:11 2014 +0200

    updated genesis_hash

commit b315da618b
Merge: 7a7e198 0a76a3a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 14 10:33:26 2014 +0200

    Merge pull request #23 from ethers/fix22

    numbers should be strings #22

commit 0a76a3a312
Author: ethers <ethereum@outlook.com>
Date:   Mon Oct 13 14:45:30 2014 -0700

    numbers should be strings #22

commit 1f67385f13
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:18:00 2014 +0200

    Added some MUL tests

commit 7a7e198395
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:11:59 2014 +0200

    Added some MUL tests

commit 46eb6283ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 12:18:13 2014 +0200

    tested new opcodes (JUMPDEST,CALLCODE) and created test for CALL/CREATE depth

commit 8d38d62d10
Author: Nick Savers <nicksavers@gmail.com>
Date:   Fri Oct 10 18:09:41 2014 +0200

    INVALID stops the operation and doesn't cost gas

commit ed6eba7c8e
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 19:08:48 2014 +0200

    Update + ABA recursive bomb which needs maximum recursion limit of 1024

commit 2d72050db1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 14:37:18 2014 +0200

    Applied recent protocol changes (PoC7) to existin tests

commit dfe66cab3f
Merge: 4513623 1a67a96
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 11:05:51 2014 +0200

    Merge remote-tracking branch 'origin/develop'

    Conflicts:
    	genesishashestest.json

commit 1a67a96cff
Merge: a4f5f45 ffd6bc9
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 15:10:23 2014 +0100

    Merge pull request #18 from CJentzsch/develop

    CallToNameRegistratorOutOfGas balance correction

commit ffd6bc97ad
Merge: a4f5f45 9779d67
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:47:34 2014 +0200

    Merge remote-tracking branch 'origin/develop' into develop

commit 9779d67b8c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:45:53 2014 +0200

    CallToNameRegistratorOutOfGas balance correction

    Even if execution fails, the value gets transferred.

commit a4f5f45228
Merge: 49a9f47 b6d7cba
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 14:13:12 2014 +0100

    Merge pull request #17 from CJentzsch/develop

    Added A calls B calls A contracts

commit b6d7cba499
Merge: 865cb40 49a9f47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 865cb4083d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:36 2014 +0200

    Added A calls B calls A contracts

commit 49a9f47aec
Merge: 3b0ec43 94a493b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Tue Oct 7 10:56:17 2014 +0200

    Merge pull request #16 from CJentzsch/develop

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 94a493b0d9
Merge: 72853c4 3b0ec43
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:32 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 72853c4382
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:07 2014 +0200

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 3b0ec436e4
Merge: aec3252 222068b
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 05:52:43 2014 +0100

    Merge pull request #15 from CJentzsch/develop

    corrected tests and different style for storage

commit 222068b9ba
Merge: c169653 aec3252
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:28 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit c1696531a6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:09 2014 +0200

    corrected tests and different style for storage

commit aec3252b8e
Merge: 25f9fd5 e17a909
Author: vbuterin <v@buterin.com>
Date:   Mon Oct 6 09:39:46 2014 +0100

    Merge pull request #14 from CJentzsch/develop

    corrected gas limit in vmSystemOperationsTest

commit e17a909f70
Merge: 33fcab5 25f9fd5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:31:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 33fcab5727
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:30:04 2014 +0200

    Bug fix, corrected gasLimit in vmSystemOperationsTest

commit 25f9fd542a
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:47:00 2014 -0400

    one more vm test

commit 2d561a5373
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:15:37 2014 -0400

    separated out vmtests

commit b0c48fa8d6
Merge: cb8261a 6cae166
Author: vbuterin <v@buterin.com>
Date:   Sat Oct 4 17:18:02 2014 +0100

    Merge pull request #13 from CJentzsch/develop

    Added comprehensive EVM test suite. All commands are tested.

commit 6cae166f6f
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 15:34:23 2014 +0200

    Delete tmp.json

commit 4ff906fbc2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 14:06:32 2014 +0200

    corrected CALLSTATELESS tests

commit 5b3fee6806
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 29 13:08:44 2014 +0200

    Completed vm tests. Added ADDMOD, MULMOD, POST, CALLSTATELESS

commit 9cdd218083
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 27 21:48:09 2014 +0200

    Added IOandFlowOperation-, PushDupSwap- and SystemOperations- tests. Removed empty storage from adresses.

commit 28ed968b46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:49:22 2014 +0200

    Added blockInfoTest

commit ffbd5a35b5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:37:52 2014 +0200

    Added environmentalInfo- and sha3- test

commit 54c14f1ff3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 22 13:06:57 2014 +0200

    Added bitwise logic operation test

commit d0af113aab
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 20 01:42:51 2014 +0200

    Added vm arithmetic test

commit cb8261a78b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Sep 19 13:15:44 2014 +0200

    Update genesishashestest.json

commit 4513623da1
Author: Maran <maran.hidskes@gmail.com>
Date:   Tue Jul 22 12:24:46 2014 +0200

    Update keyaddrtest to be valid JSON

commit e8cb5c221d
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 21 23:30:33 2014 -0400

    Added next/prev trie test

commit 98823c04b3
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 14 02:51:31 2014 -0400

    Replaced with deterministic test

commit 357eb21e4d
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun Jul 13 16:12:56 2014 -0400

    Added my own random and namecoin tests (pyethereum)

commit 00cd0cce8f
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jul 12 21:20:04 2014 +0200

    Output hex strings.

commit ddfa3af45d
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 11:28:35 2014 +0100

    Everything a string.

commit d659f469a9
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 10:16:25 2014 +0100

    Code fixes.

commit 5e83ea8228
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 16:17:12 2014 +0200

    Prettier VM tests.

commit a09aae0efe
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 15:46:01 2014 +0200

    Fix VM tests.

commit ec9a044a17
Merge: 4bb6461 5e0123f
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Jul 4 15:56:52 2014 +0200

    Merge pull request #10 from romanman/patch-1

    Update vmtests.json

commit 5e0123fbe1
Author: romanman <roman.mandeleil@gmail.com>
Date:   Fri Jul 4 10:23:04 2014 +0100

    Update vmtests.json

commit 2b6da2f5f2
Author: romanman <roman.mandeleil@gmail.com>
Date:   Thu Jul 3 17:45:04 2014 +0100

    Update vmtests.json

    arith testcase updated

commit 4bb646117d
Merge: bba3898 a33b309
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:22 2014 +0200

    Merge branch 'develop' of github.com:/ethereum/tests into develop

commit bba38980bd
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:06 2014 +0200

    New tests.

commit a33b309d99
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:14:05 2014 -0400

    Testing submodules

commit 50318217ca
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:10:46 2014 -0400

    Testing submodules

commit 57fa655522
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:09:08 2014 -0400

    Testing submodules

commit ea0eb0a8c8
Author: Gav Wood <i@gavwood.com>
Date:   Tue Jul 1 15:19:34 2014 +0200

    Latest genesis block.

commit 25bb76b69c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 13:25:04 2014 +0200

    Reset

commit 74c6d8424e
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 12:10:06 2014 +0200

    Updated wrong test

commit 9ea3a60291
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Sat Jun 28 18:48:28 2014 +0200

    Fixed roots

commit 5fc3ac0e92
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:40:06 2014 +0200

    Simple hex test.

commit edd3a00c2a
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:22:18 2014 +0200

    Additional test for jeff. Now use the 0x... notation.

commit 5021e0dd83
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 21:35:26 2014 +0200

    VM test framework updated.

commit c818d13202
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 18:18:24 2014 +0200

    Removed arrays from Trie tests JSON as per conformance guide and changed
    vocabulary to match other tests.
    VM test updates.

commit 714770ffb3
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jun 11 11:32:42 2014 +0100

    Added Gav's new address.

commit 9345bc13d4
Merge: a2257f3 78576dd
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:38 2014 +0200

    Merge branch 'master' of github.com:ethereum/tests into develop

commit a2257f3471
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:18 2014 +0200

    VM tests.

commit 78576dd3d3
Author: Heiko Heiko <heiko@heiko.org>
Date:   Fri May 30 17:19:09 2014 +0200

    changes based on new account structure nonce, balance, storage, code

commit 125839e848
Merge: 42e14ec 356a329
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu May 22 09:58:45 2014 +0200

    Merge pull request #5 from bkirwi/master

    Fix invalid JSON (removed trailing comma) and add test names

commit 356a3296bc
Author: Ben Kirwin <ben@kirw.in>
Date:   Thu May 22 00:20:48 2014 -0400

    Add some arbitrary test names

    This should now conform to the format specified in the README.

commit 42e14ec54f
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 23:27:40 2014 +0800

    revert to correct data

commit 4300197a74
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:42:23 2014 +0800

    fix: wrong sha3 hash because of the wrong rlp hex

commit a0d01b1a0b
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:29:53 2014 +0800

    fix: wrong rlp hex

commit 6bc2fc7405
Merge: 66bc366 c31a93c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed May 21 14:11:37 2014 +0200

    Merge pull request #4 from ethers/master

    fix file name that seems to have been a typo

commit c31a93c27a
Author: ethers <ethereum@outlook.com>
Date:   Tue May 20 15:42:39 2014 -0700

    fix file name that seems to have been a typo

commit 66bc3665c1
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:36:35 2014 +0200

    fix: represent integers as strings

commit ede5499da6
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:21:09 2014 +0200

    add: current initial alloc and genesis hashes

commit 5131429abb
Author: Ben Kirwin <ben@kirw.in>
Date:   Mon May 19 11:18:31 2014 -0400

    Delete a comma

    This should now be parseable as JSON.

commit f44a859331
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Sun May 18 15:04:42 2014 +0800

    add: case when value is long, ensure it's not get rlp encoded as node

commit e1ae4ad449
Author: Gav Wood <i@gavwood.com>
Date:   Mon May 12 14:40:47 2014 +0100

    PoC-5 VM tests.

commit 2b6c136dda
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun May 11 21:42:41 2014 -0400

    Moved txt to json

commit cbccbf977c
Merge: edbb8d4 45a0974
Author: Vitalik Buterin <v@buterin.com>
Date:   Thu May 8 21:54:48 2014 -0400

    New commit

commit edbb8d407e
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue May 6 16:53:43 2014 -0400

    Removed unneeded test, added new tests

commit 45a0974f6f
Merge: 15dd8fd 5fd2a98
Author: Gav Wood <i@gavwood.com>
Date:   Sun Apr 27 12:53:47 2014 +0100

    Merge pull request #3 from autolycus/develop

    Fixed formatting and added test cases

commit 5fd2a98fcb
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 13:26:14 2014 -0700

    Added some new test cases for the rlp encoding.

commit 4ba150954e
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 12:48:42 2014 -0700

    Converted spaces to tabs to be compliant with the coding standards defined in cpp-ethereum

commit 15dd8fd794
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 12:54:47 2014 +0000

    RLP tests and Trie updates.

commit 33f80fef21
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:39:35 2014 +0000

    Hex encode tests done.

commit e1f5e12abb
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:22:49 2014 +0000

    Fix RLP tests.

commit f87ce15ad2
Author: Gav Wood <i@gavwood.com>
Date:   Thu Feb 27 13:28:11 2014 +0000

    Fix empty string.

commit c006ed4ffd
Author: Gav Wood <i@gavwood.com>
Date:   Mon Feb 24 10:24:39 2014 +0000

    Tests fix.

commit 510ff56363
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:54:08 2014 +0000

    Updated the tests.

commit a0ec843832
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:49:24 2014 +0000

    Moved over to new format, but RLP tests still need updating.

commit 660cd26f31
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:35:51 2014 +0000

    More docs.

commit 6ad14c1a15
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:33:39 2014 +0000

    Added VM test suite.
    Added TODO.
    Renamed old files.

commit f91ad7b385
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 11:26:58 2014 -0500

    update trie algorithm

commit 6da2954462
Merge: cc42246 131c610
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 08:15:38 2014 -0500

    merge

commit cc4224675f
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Jan 7 14:35:26 2014 -0500

    Updated trie test

commit 131c610da6
Merge: 121632b 7613302
Author: vbuterin <v@buterin.com>
Date:   Wed Jan 1 06:40:54 2014 -0800

    Merge pull request #1 from obscuren/master

    Update trietest.txt

commit 7613302b49
Author: obscuren <obscuren@users.noreply.github.com>
Date:   Wed Jan 1 15:25:21 2014 +0100

    Update trietest.txt

    New proposed explanatory format

commit 121632bedd
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 1 08:26:18 2014 -0500

    Added obscure's tests

commit ef6c5506c3
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 19:04:48 2013 -0500

    Fixed tests a bit

commit 345e4bcfef
Merge: 2c81698 e4bbea4
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 15:52:46 2013 -0500

    Merge branch 'master' of github.com:ethereum/tests

commit 2c81698f31
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Dec 30 21:09:40 2013 -0500

    Added first three tests

commit e4bbea400f
Author: vbuterin <v@buterin.com>
Date:   Mon Dec 30 18:09:03 2013 -0800

    Initial commit
2015-01-02 17:33:14 +01:00
4dc7ee9087 Closure => Context 2015-01-02 16:14:12 +01:00
e2d1d832ef added nil check 2015-01-02 13:00:25 +01:00
d336e24dce Removed the need of having a backend for the tx pool 2015-01-02 12:26:55 +01:00
ae2c90cc28 Removed value check from tx validation 2015-01-02 12:24:36 +01:00
6cf61039cf Added tests for valid transactions 2015-01-02 12:18:23 +01:00
48d2a8b8ee Refactored tx pool and added extra fields to block
* chain manager sets td on block + td output w/ String
* added tx pool tests for removing/adding/validating
* tx pool now uses a set for txs instead of list.List
2015-01-02 12:09:38 +01:00
477a6d426c Added a query interface for world state 2015-01-02 12:07:54 +01:00
0972bdeda2 Fixed using new trie iterator API 2015-01-02 12:07:26 +01:00
1cc86c07a0 Deleted 2015-01-02 11:16:52 +01:00
1c7e8e9093 Set TD to block once processed 2015-01-02 11:16:42 +01:00
b619b244c7 Fixed tests 2015-01-02 11:16:30 +01:00
0fb1bcd321 Merge branch 'poc8' into docbranch 2015-01-02 10:30:27 +01:00
a4dc12f12c Additional comments and added name to error output 2014-12-31 11:21:39 +01:00
4547a05a68 Minor improvements
* Moved gas and mem size to its own function
2014-12-31 11:12:40 +01:00
4b4e082102 JUMPI never 'require' checked. 2014-12-31 10:32:53 +01:00
1954b87819 bring back toHex 2014-12-30 11:59:33 -05:00
77924757a8 Merge branch 'develop' into poc8 2014-12-30 17:16:35 +01:00
16460b0048 Fixed gas check for vm test 2014-12-30 17:16:28 +01:00
a9068aa8ff Merge branch 'develop' into poc8 2014-12-30 17:10:02 +01:00
89244981a8 Additional checking on gas 2014-12-30 17:09:54 +01:00
138ab26b8c SIGNEXTEND missing from stack check 2014-12-30 17:09:43 +01:00
51a97c031f Merge branch 'develop' into poc8 2014-12-30 16:22:56 +01:00
cc5e621fc4 updated tests 2014-12-30 16:18:46 +01:00
2ebf33ac1c removed variable 2014-12-30 16:17:56 +01:00
788d812a72 Merge branch 'develop' into poc8 2014-12-30 16:16:11 +01:00
29c887ef2c Removed incorrect range check for push 2014-12-30 16:16:02 +01:00
1085960ed8 fixed trie 2014-12-30 15:58:40 +01:00
8df689bd44 Chain tests 2014-12-30 15:42:26 +01:00
2f8a45cd8b Fixed chain test & added new chain 2014-12-30 13:32:01 +01:00
ce68ac6959 Updated miner to new block api 2014-12-30 13:18:19 +01:00
dc7c584a4d export => import 2014-12-24 14:54:06 +01:00
58d477f7a6 Fixed a bug where keys where serialised twice 2014-12-24 14:47:50 +01:00
804af9658a merge 2014-12-24 11:31:45 +01:00
9d429180f9 Merge branch 'hotfix/0.7.11' into develop 2014-12-24 11:31:08 +01:00
771bfe9e78 Merge branch 'hotfix/0.7.11' 2014-12-24 11:30:13 +01:00
c9f963a77e Bump 2014-12-24 11:30:04 +01:00
7ba9fe4d5d Reset peer during download on disc 2014-12-24 11:29:58 +01:00
fb1edd05f4 Removed the deferred reset 2014-12-24 11:20:43 +01:00
780abaec98 Switched to new trie 2014-12-23 18:35:36 +01:00
f468a9a0e2 Enable websockets for mist. Closes #218 2014-12-23 15:47:08 +01:00
1054c155db Moved import to utils 2014-12-23 15:37:03 +01:00
7d2353f24d Close the file 2014-12-23 15:31:03 +01:00
34f72ddb3d Decode from stream directly 2014-12-23 15:18:48 +01:00
1382e8d84b Delete current chain for reset 2014-12-23 14:50:04 +01:00
e2e3fa3d11 Updated Mist to use new blocks 2014-12-23 14:44:45 +01:00
9e5257b83b Chain importer 2014-12-23 14:33:15 +01:00
4cd79d8ddd Refactored block & Transaction
* Includes new rlp decoder
2014-12-23 13:48:44 +01:00
4b52cd512d Removal of "debug" url :) 2014-12-22 15:01:52 +01:00
e32f7baa0d Concat and pad data 2014-12-22 14:59:52 +01:00
60b1f9629c Merge branch 'develop' into poc8 2014-12-22 14:46:32 +01:00
4051c0333f Added whisper js api 2014-12-22 13:23:11 +01:00
e42517754a updated ethereum.js 2014-12-22 11:57:13 +01:00
a153b47c2b moved 2014-12-22 11:56:34 +01:00
e531c6fc6c Merge pull request #217 from ethereum/tests
Updated code coverage support & cleanup
2014-12-22 11:42:28 +01:00
ed7e05fb2a Merge branch 'develop' into poc8 2014-12-22 10:58:30 +01:00
8130df63ca updated whisper ui 2014-12-22 10:58:28 +01:00
123098ce79 Lots of fixes. 2014-12-22 01:13:49 +01:00
4fd4facf35 Remove old file 2014-12-21 14:54:51 -06:00
43bf3b4a78 Move goveralls call to script 2014-12-21 14:46:32 -06:00
05da381c15 Add coveralls coverage badge 2014-12-21 14:36:13 -06:00
26bf95731b Use repo default branches 2014-12-21 14:31:19 -06:00
03dc6ec0d4 Update travis go version to tip 2014-12-21 13:46:06 -06:00
f7ec759ef0 inline dependency installation script 2014-12-21 13:34:48 -06:00
7ddebd7a75 Exclude VM tests 2014-12-21 13:21:24 -06:00
bab78bbeb6 Merge branch 'tests' of github.com:ethereum/go-ethereum into tests 2014-12-21 12:06:24 -06:00
7a79428278 Update cover command installation 2014-12-21 12:05:59 -06:00
1360f027d9 Merge pull request #216 from ethereum/develop
Update tests branch from develop
2014-12-21 11:42:32 -06:00
b3629c6f62 remove temp coverage file 2014-12-21 11:19:33 -06:00
176c98eb66 Updated tool import paths 2014-12-21 11:18:43 -06:00
25d16f358a Merge branch 'develop' 2014-12-21 15:13:45 +01:00
795b14330a Fixed EVM environment. Closes #215 2014-12-21 15:13:06 +01:00
0e5aed63dd Updated QWhisper
* changed api
* general whisper debug interface
2014-12-21 15:06:35 +01:00
125bdc3253 Merge branch 'develop' into poc8
Conflicts:
	cmd/ethereum/flags.go
2014-12-20 02:45:05 +01:00
6cff6dd8b8 Merge branch 'release/v0.7.10' into develop 2014-12-20 02:34:29 +01:00
3983dd2428 Merge branch 'release/v0.7.10' 2014-12-20 02:34:12 +01:00
0a9dc1536c Increased peer from 10 to 30 2014-12-20 02:33:45 +01:00
1508a23a6f Minor updates on gas and removed/refactored old code. 2014-12-20 02:21:13 +01:00
f5b8f3d41b Removed OOG check. Revert should always happen. 2014-12-19 13:59:49 +01:00
0e93b98533 Transaction was generating incorrect hash because of var changes 2014-12-19 13:34:53 +01:00
5da5db5a0a Added authors 2014-12-19 13:34:21 +01:00
88af879f7a version bump 2014-12-19 01:18:22 +01:00
75f0412f9d Merge branch 'ebuchman-badsig' into poc8 2014-12-19 00:33:32 +01:00
207b6c50fb Merge branch 'badsig' of https://github.com/ebuchman/go-ethereum into ebuchman-badsig
Conflicts:
	core/transaction_pool.go
2014-12-19 00:33:05 +01:00
12671c82ea Moved VM to execution 2014-12-19 00:23:00 +01:00
6e24b1587d Merge branch 'develop' into poc8 2014-12-19 00:19:02 +01:00
59ef6e3693 Cleaned up objects 2014-12-19 00:18:52 +01:00
22d29a6d52 merge 2014-12-19 00:02:55 +01:00
a7f4ade711 Fixed tests 2014-12-18 23:59:53 +01:00
1e985f9865 Fixed casting error
* big(bytes) == 0 when len(bytes) > 0
2014-12-18 23:59:40 +01:00
4789084998 updated tests 2014-12-18 23:32:58 +01:00
3325683794 Fixed refund model 2014-12-18 22:38:51 +01:00
f7287c626e updated tests 2014-12-18 21:58:53 +01:00
198cc69357 Gas corrections and vm fixes 2014-12-18 21:58:26 +01:00
5ad473d758 Moved methods to messages 2014-12-18 15:33:22 +01:00
db494170dc Created generic message (easy for testing) 2014-12-18 15:18:13 +01:00
9e286e1c33 updated tests 2014-12-18 13:32:47 +01:00
0dc566124a Merge fixes 2014-12-18 13:22:59 +01:00
721e8ae93f Merged develop 2014-12-18 13:19:41 +01:00
2d09e67713 Updated to new methods 2014-12-18 13:17:24 +01:00
49e0267fe7 Locks, refactor, tests
* Added additional chain tests
* Added proper mutex' on chain
* Removed ethereum dependencies
2014-12-18 13:12:54 +01:00
590aace88d Removed ethereum as dependency 2014-12-18 12:18:19 +01:00
4b2f1f7628 idx should return -1 2014-12-18 11:55:46 +01:00
df3366d910 Rlp shouldn't write null bytes 2014-12-18 11:39:24 +01:00
e6fdf0c9f7 Merge branch 'develop' into poc8 2014-12-18 00:12:51 +01:00
4dbdcaecb1 Moved pre-compiled, moved depth check
* Depth check has been moved to the execution
* Pre compiled execution has been moved to the VM
* PrecompiledAddress has been renamed to PrecompiledAccount
2014-12-17 23:58:52 +01:00
8da07e91e4 Merge pull request #213 from ethereum/develop
moved err check
2014-12-17 13:00:05 +01:00
b1c58b76a9 moved err check 2014-12-17 12:57:35 +01:00
52b54631a4 Whisper watches fixes 2014-12-16 19:55:57 +01:00
e9db2d1b18 Merge pull request #15 from debris/master
changes from cpp-ethereum
2014-12-16 11:10:28 +01:00
93edae280d doc desc 2014-12-15 22:50:38 +01:00
bb17591959 Merge pull request #211 from fjl/fix-server-disc
p2p: fix call to Server.removePeer
2014-12-15 22:50:05 +01:00
aa3b91b802 p2p: fix call to Server.removePeer (might help with #209) 2014-12-15 22:36:59 +01:00
b55fabc7be Removed debug message 2014-12-15 22:18:58 +01:00
54605d8c8e During env open check for pub error which indicated unencrypted payload. 2014-12-15 21:55:00 +01:00
52ca80bdd2 Fixed deref ptr
The gui already waits and shuts down ethereum. There was no need to wait
for an additional shutdown.
2014-12-15 21:53:50 +01:00
0291eff99a Identity test 2014-12-15 21:52:50 +01:00
c96e504adb Typo 2014-12-15 17:28:51 +01:00
01a6db9324 Added whisper debug interface + whisper fixes 2014-12-15 17:14:02 +01:00
993280ec03 Added whisper test 2014-12-15 17:09:27 +01:00
6ff9d5770b Added whisper handler 2014-12-15 17:09:14 +01:00
455241debb Removed goroutine from "Run" 2014-12-15 17:09:06 +01:00
db89c3e1a3 Merge branch 'develop' into poc8 2014-12-15 16:13:08 +01:00
ef4135eabe Added topic utility functions to whisper 2014-12-15 16:12:34 +01:00
56dac74f71 made mist in a compilable, workable state using the new refactored packages 2014-12-15 13:00:29 +01:00
c7bc684909 Moved peer helper metheds 2014-12-15 12:35:21 +01:00
96272e19a6 removed filter manager from base 2014-12-15 12:34:06 +01:00
bd9088792b Merge branch 'develop' into ethersphere-ethp2p 2014-12-15 12:22:03 +01:00
cdb2ebbdfa Added old filter. Needs some refactoring 2014-12-15 12:17:33 +01:00
4b5ad31b3a WIP 2014-12-15 12:07:46 +01:00
6c168c8f22 added protocol handler 2014-12-15 12:02:48 +01:00
afc8b887ab added whisper 2014-12-15 12:01:55 +01:00
f111fc0608 WIP 2014-12-15 11:38:09 +01:00
1d959cb0ca WIP 2014-12-15 11:37:01 +01:00
c3ba4ace64 Merge branch 'poc8' into develop 2014-12-15 10:22:57 +01:00
15e46b97b4 Merge pull request #204 from fjl/fix-p2p-disconnect
p2p: fix decoding of disconnect reason
2014-12-15 10:22:35 +01:00
da900f9435 p2p: add test for base protocol disconnect 2014-12-15 00:28:20 +01:00
f0f6727778 p2p: use an error type for disconnect requests
Test-tastic.
2014-12-15 00:28:20 +01:00
65e39bf20e p2p: add MsgPipe for protocol testing 2014-12-15 00:28:20 +01:00
72290f67fe resolve merge conflict hell 2014-12-14 20:57:29 +00:00
4c89d5331f adapt blockpool/backend to use pow/ezp with pow.Block for VerifyPoW func 2014-12-14 20:53:20 +00:00
61940b2275 adapt cmd/cli to new backend
- new flag nat for nat support UPNP|PMP
- new flag pmp for PMP gateway IP
- add NatType to utils/cmd to get p2p.NAT from nat type string
- obsolete usepnp flag
- get rid of IsUpToDate and sleep in miner start
- ethereum constructor takes nat type, port, maxpeer
- add pubkey arg to client identity
2014-12-14 20:52:28 +00:00
e77b720ead blockmanager start/stop obsolete 2014-12-14 20:45:12 +00:00
7b39cc83cc adapt chain_manager to eth protocol interface
- add Status() to return td, currentblock hash, genesis hash
- GetChainHashesFromHash -> GetBlockHashesFromHash
2014-12-14 20:45:12 +00:00
01dc1c1394 blockpool rewritten , tests broken FIXME 2014-12-14 20:42:08 +00:00
4dfce4624d protocol
- new interface explicit backend components txPool, chainManager, blockPool
- added protoErrorDisconnect for blockpool callback (FIXME: handling peer disconnects)
2014-12-14 20:40:08 +00:00
5e4d77b2b8 initial commit for eth blockpool + test 2014-12-14 20:39:34 +00:00
2dd8f41147 eth protocol changes
- changed backend interface
- using callbacks for blockPool
- use rlp stream for lazy decoding
- use peer as logger
- add id (peer pubkey) to ethProtocol fields
- add testPeer to protocol test (temporary)
2014-12-14 20:37:07 +00:00
0add0c400f initial commit for eth-p2p integration 2014-12-14 20:34:28 +00:00
e847aaca3e remove wire package 2014-12-14 20:31:43 +00:00
7d02c4fdb7 remove old ethereum/p2p related top level files 2014-12-14 20:31:43 +00:00
d9b16c1197 new cli options
- nat UPNP|PMP
- gateway for PMP NAT
- obsolete usepnp
- add pubkey to client identity
2014-12-14 20:30:56 +00:00
ae7c1e3e55 adapt to new backend
- eth p2p pkgs
- new Ethereum initialiser
- no caps param
- use nat type
- add NatType func to map nat type string to p2p.NAT
- add pubkey to client identity
2014-12-14 20:30:56 +00:00
50e1dcc43a import eth pkg 2014-12-14 20:30:56 +00:00
d84810d89d add Status to retrieve TD, currentBlock, genesis for easy interface with eth/protocol 2014-12-14 20:30:56 +00:00
39d86a28e7 adapt to new eth pkg and p2p 2014-12-14 20:30:56 +00:00
5022a31889 add NewMinedBlockEvent 2014-12-14 20:27:06 +00:00
c2af10d256 transaction pool changes
- use eventer events to broadcast transactions
- CurrentTransactions -> GetTransactions
- add AddTransactions
2014-12-14 20:27:06 +00:00
b89ed8eb7b adapt javascript pkg to new backend, use SuggestPeer 2014-12-14 20:27:06 +00:00
118862f1ba adapt miner to new backend. use events to broadcast new mined blocks 2014-12-14 20:27:06 +00:00
148de1c875 adapt xeth pkg to new backend. FIXME JSPeer peer info 2014-12-14 20:27:06 +00:00
76070b4674 blockpool rewritten , tests broken FIXME 2014-12-14 20:27:06 +00:00
3308d82b23 add protocol error types specific to blockpool 2014-12-14 20:27:06 +00:00
c44e025898 protocol
- new interface explicit backend components txPool, chainManager, blockPool
- added protoErrorDisconnect for blockpool callback (FIXME: handling peer disconnects)
2014-12-14 20:27:06 +00:00
02017ed0e0 initial commit for new backend (eth.Ethereum) 2014-12-14 20:27:06 +00:00
4366fdfc13 initial commit for eth blockpool + test 2014-12-14 20:27:06 +00:00
d957dd2c9f eth protocol changes
- changed backend interface
- using callbacks for blockPool
- use rlp stream for lazy decoding
- use peer as logger
- add id (peer pubkey) to ethProtocol fields
- add testPeer to protocol test (temporary)
2014-12-14 20:27:06 +00:00
eb5cb04aa9 no logging in error (to be refactored into p2p) 2014-12-14 20:27:05 +00:00
e5aa38cb0f initial commit for eth-p2p integration 2014-12-14 20:27:05 +00:00
f8061fcba8 fixed tests 2014-12-12 22:38:54 +01:00
4c84db85c5 eth-go packages ended up in whisper 2014-12-12 22:29:29 +01:00
0122989808 Merge branch 'poc8' into develop 2014-12-12 22:27:12 +01:00
ccb4fc8d03 Merge pull request #206 from ethereum/tests
Added Dockerfile to build from source
2014-12-12 22:26:54 +01:00
aec0c0efcb updated tests 2014-12-12 22:25:29 +01:00
bf566a657c Implemented Qt whisper interface 2014-12-12 22:24:41 +01:00
8577e4171a Panic for "Vm" 2014-12-12 22:24:27 +01:00
06e76422b5 Added length checkes 2014-12-12 22:24:04 +01:00
1c7fd62e57 Moved 2014-12-12 22:23:52 +01:00
a17a1f9208 Implemented watching using filter package
* Added filters / watches
* Removed event dep
2014-12-12 22:23:42 +01:00
ed1538248f Moved filter to events 2014-12-12 22:19:39 +01:00
9e1689df9c Generic filter interface 2014-12-12 21:42:21 +01:00
ca7f385294 Fix variable name 2014-12-12 10:54:32 -06:00
a92ccfc5c6 Added Dockerfile to build from source 2014-12-12 10:50:07 -06:00
25cf0c440c Accidentally changed max depth during testing & committed 2014-12-12 15:25:21 +01:00
05fd1dafe2 additional log 2014-12-12 13:26:01 +01:00
e28c60caf9 p2p: improve and test eofSignal 2014-12-12 11:40:02 +01:00
9423401d73 p2p: fix decoding of disconnect reason (fixes #200) 2014-12-12 11:40:02 +01:00
0d57ca486a Squashed commit of the following:
commit 779f25d36c
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 11 22:59:56 2014 +0100

    first random test

commit 68175386c0
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 11 21:34:50 2014 +0100

    update gas prices

commit ad322fbb58
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 8 06:01:17 2014 +0100

    Log as array

commit f989f42618
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Fri Dec 5 15:12:12 2014 +0100

    state log tests

commit 4bc65d1129
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 4 18:18:49 2014 +0100

    add calldataload, codecopy, extcodecopy tests

commit 12cfae18e3
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Thu Dec 4 15:57:56 2014 +0100

    add calldataload test

commit 086caf3701
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Wed Dec 3 08:31:03 2014 +0100

    protocol update (CALLCODE <-> RETURN), topics in log are arrays not sets

commit e6c92673b9
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 21:14:08 2014 +0100

    update state tests with logs

commit 4089b809fb
Author: CJentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 18:19:40 2014 +0100

    update gas costs

commit cfdca62277
Merge: 2e5175e f59f89d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Dec 1 18:04:51 2014 +0100

    Merge pull request #42 from negedzuregal/fix

    vmTest fix

commit f59f89d876
Author: alon muroch <alonmuroch@gmail.com>
Date:   Mon Dec 1 16:18:12 2014 +0100

    vmEnvironmentalInfoTest CALLDATACOPY, CODECOPY, EXTCODECOPY fix

commit 68da13fe3e
Author: alon muroch <alonmuroch@gmail.com>
Date:   Mon Dec 1 11:10:57 2014 +0100

    vmArithmeticTest exp fix

commit 2e5175e818
Author: ethers <ethereum@outlook.com>
Date:   Sun Nov 30 19:55:51 2014 +0100

    add vmLogTest

commit b5b9408e64
Author: Heiko Heiko <heiko@heiko.org>
Date:   Sun Nov 30 16:27:27 2014 +0100

    updated genesis to new header w/o min_gas_price

commit 8e69fbfa98
Author: ethers <ethereum@outlook.com>
Date:   Fri Nov 21 17:42:05 2014 -0800

    add special tests

commit 90f4f942e6
Author: ethers <ethereum@outlook.com>
Date:   Thu Nov 20 19:01:09 2014 -0800

    typo

commit c5e5228e0d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 20 17:04:06 2014 +0100

    Removed log,post,out,gas,callcreates if exception occured

commit 9c0232a2b9
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 18:19:05 2014 +0100

    MakeMoney test

commit 3ba0007e86
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 16:23:04 2014 +0100

    Added log sections in all vmtests + log tests

commit d84be4fe07
Merge: c8497ab 76d2542
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 10:00:24 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit c8497ab257
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 19 10:00:02 2014 +0100

    new push32 test and renaming

commit 76d25420e1
Author: ethers <ethereum@outlook.com>
Date:   Mon Nov 17 18:59:30 2014 -0800

    adding test

commit 0be275e757
Merge: 1d42d1d d90868c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 22:47:34 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 1d42d1d7c6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 22:46:51 2014 +0100

    fix ecrecover2

commit d90868c307
Merge: 1f38c8c 6dbcf6b
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 17 20:26:59 2014 +0100

    Merge pull request #39 from wanderer/develop

    added test for max call depth on creation

commit 6dbcf6b0d6
Author: wanderer <mjbecze@gmail.com>
Date:   Mon Nov 17 14:06:43 2014 -0500

    spelling fix

commit 6fc07a7f81
Author: wanderer <mjbecze@gmail.com>
Date:   Sat Nov 15 21:39:16 2014 -0500

    added test for max call depth on creation

commit 1f38c8c0a2
Merge: 279b284 cd85ca1
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 20:10:21 2014 -0500

    Merge pull request #38 from wanderer/develop

    updated test  'jeff' in trietest.json

commit cd85ca17ed
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 19:59:34 2014 -0500

    Update trietest.json

commit 279b284c0d
Merge: 89675a7 6cae937
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 17:43:49 2014 -0500

    Merge pull request #37 from wanderer/develop

    Update trietest.json

commit 6cae937e5e
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Fri Nov 14 17:20:03 2014 -0500

    Update trietest.json

    'emptyValues' should have the same root as 'puppy'

commit 89675a7153
Merge: f1de1cc 32f0c47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 23:17:49 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit f1de1cc97a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 23:17:13 2014 +0100

    Fix CallRecursiveBomb2

commit 32f0c47c68
Merge: ab50e76 3da90d0
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Thu Nov 13 15:26:49 2014 -0500

    Merge pull request #36 from wanderer/develop

    converted back to arrary format

commit ab50e76652
Merge: d06b792 78f1e4a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 13 07:52:35 2014 +0100

    Merge pull request #35 from ethers/delOld

    rename tests since they are valid opcodes that exist

commit 3da90d01f6
Author: wanderer <mjbecze@gmail.com>
Date:   Wed Nov 12 22:22:47 2014 -0500

    converted back to arrary format

commit 78f1e4a945
Author: ethers <ethereum@outlook.com>
Date:   Wed Nov 12 19:11:06 2014 -0800

    rename tests since they are valid opcodes that exist

commit d06b792cd0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 12 07:00:17 2014 +0100

    minor change in CallSha256_1_nonzeroValue test

commit d434ecdcc3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 12 06:56:31 2014 +0100

    Added CallSha256_1_nonzeroValue test

commit 2c06f34cc0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 18:10:26 2014 +0100

    Store return value of call to precompiled contracts

commit 4b0c3b29ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 17:51:14 2014 +0100

    Fix gas cost for OOG calls

commit 63bcca7604
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue Nov 11 08:59:19 2014 +0100

    fix: genesis test

commit 6e0310c1ea
Merge: 30c266c 2927763
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 08:34:36 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 30c266caff
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 11 08:33:59 2014 +0100

    jump to position outside code stops execution

commit 2927763d68
Author: ethers <ethereum@outlook.com>
Date:   Mon Nov 10 14:10:22 2014 -0800

    RandomTests were removed

commit a0fa91b2b8
Merge: 6092484 fcba866
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 10 22:22:05 2014 +0100

    Merge branch 'develop' of https://github.com/ethereum/tests into develop

commit 60924843f0
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 10 22:21:37 2014 +0100

    Unintended Exceptions work like OOG

commit fcba866721
Author: ethers <TODO>
Date:   Thu Nov 6 14:19:59 2014 -0800

    add StateTests

commit a441074ba4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 17:54:36 2014 +0100

    Updated precompiled contracts test

commit 0afa72c82b
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 15:27:45 2014 +0100

    Added precompiledContracts tests

commit 6be83dd5a1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 13:31:34 2014 +0100

    Update gas cost for PoC7

commit c18b8ab2d3
Merge: 66c2e1f 9a93258
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 09:19:53 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 66c2e1f642
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Nov 6 09:19:22 2014 +0100

    Updated SIGNEXTEND tests

commit 9a9325822e
Author: ethers <TODO>
Date:   Wed Nov 5 16:20:26 2014 -0800

    part of 9b4e768 - Delete vmNamecoin.json

commit e229374f46
Merge: 189527e 9b4e768
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:59:49 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 189527e563
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:59:20 2014 +0100

    added dynamic jump out of code

commit 9b4e768995
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 20:41:54 2014 +0100

    Delete vmNamecoin.json

commit 4669b5694b
Merge: a567fed aaba185
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 15:00:12 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit a567fedaa7
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Nov 5 14:59:08 2014 +0100

    added state systemOperationsTest

commit aaba185ceb
Merge: 79d7cbf fa782ae
Author: ethers <ethereum@outlook.com>
Date:   Tue Nov 4 12:15:40 2014 -0800

    Merge pull request #32 from ethers/indexjs

    updates needed per restructure

commit fa782aed93
Author: ethers <TODO>
Date:   Tue Nov 4 11:28:56 2014 -0800

    updates needed per restructure

commit 79d7cbfc4a
Merge: 9120274 1c1ba8d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:32:11 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 9120274a46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:31:27 2014 +0100

    Update tests to latest protocol changes (PoC7)

commit 1c1ba8d161
Merge: 014d370 3aebe53
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:30:52 2014 +0100

    Merge pull request #31 from CJentzsch/develop

    Restructered tests in folders in accordance to test suites

commit 3aebe532e5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:58:21 2014 +0100

    Updated vmNamecoin.json to new sstore prices

commit 8a0be21839
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:53:00 2014 +0100

    Added example state test

commit 83643addbc
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:36:25 2014 +0100

    removed systemoperationstests

commit 3930ca3a9a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:22:15 2014 +0100

    Restructered tests in folders in accordance to test suites

commit 014d370b5d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 21:23:56 2014 +0100

    New SIGNEXTEND tets

commit 155d449be2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 20:59:05 2014 +0100

    New tests for BNOT and SIGNEXTEND

commit c9eae764b8
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 28 12:58:27 2014 +0100

    Update SSTORE gas cost and BNOT instead of NEG

commit ad2a75ac58
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 16:05:49 2014 +0200

    Added new recursive bombs

commit 834c52af64
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 12:01:05 2014 +0200

    Changing gas cost to zero at stackunderflow

commit c73a8a89d2
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed Oct 22 13:04:45 2014 +0200

    Reverted back to original value.

commit b9a8c92422
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Tue Oct 21 17:02:52 2014 -0400

    fix spelling error

commit b48ae74af4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:26:26 2014 +0200

    Added failing random tests

commit bee0a4100c
Merge: 5050d20 b315da6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:15:05 2014 +0200

    Merge remote-tracking branch 'origin/master' into develop

commit 5050d20b4d
Merge: 7516685 ba35362
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 20 20:18:20 2014 +0200

    Merge pull request #26 from wanderer/develop

    Add a package.json for node.js

commit ba35362876
Author: wanderer <mjbecze@gmail.com>
Date:   Sun Oct 19 23:59:47 2014 -0400

    turned tests into a node module

commit 751668571e
Author: ethers <ethereum@outlook.com>
Date:   Thu Oct 16 17:08:20 2014 -0700

    json was invalid and missing quotes

commit 0e687cee47
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu Oct 16 17:13:24 2014 +0200

    Update vmEnvironmentalInfoTest.json

commit 78a78e2e6c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 15 14:19:11 2014 +0200

    updated genesis_hash

commit b315da618b
Merge: 7a7e198 0a76a3a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 14 10:33:26 2014 +0200

    Merge pull request #23 from ethers/fix22

    numbers should be strings #22

commit 0a76a3a312
Author: ethers <ethereum@outlook.com>
Date:   Mon Oct 13 14:45:30 2014 -0700

    numbers should be strings #22

commit 1f67385f13
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:18:00 2014 +0200

    Added some MUL tests

commit 7a7e198395
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:11:59 2014 +0200

    Added some MUL tests

commit 46eb6283ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 12:18:13 2014 +0200

    tested new opcodes (JUMPDEST,CALLCODE) and created test for CALL/CREATE depth

commit 8d38d62d10
Author: Nick Savers <nicksavers@gmail.com>
Date:   Fri Oct 10 18:09:41 2014 +0200

    INVALID stops the operation and doesn't cost gas

commit ed6eba7c8e
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 19:08:48 2014 +0200

    Update + ABA recursive bomb which needs maximum recursion limit of 1024

commit 2d72050db1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 14:37:18 2014 +0200

    Applied recent protocol changes (PoC7) to existin tests

commit dfe66cab3f
Merge: 4513623 1a67a96
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 11:05:51 2014 +0200

    Merge remote-tracking branch 'origin/develop'

    Conflicts:
    	genesishashestest.json

commit 1a67a96cff
Merge: a4f5f45 ffd6bc9
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 15:10:23 2014 +0100

    Merge pull request #18 from CJentzsch/develop

    CallToNameRegistratorOutOfGas balance correction

commit ffd6bc97ad
Merge: a4f5f45 9779d67
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:47:34 2014 +0200

    Merge remote-tracking branch 'origin/develop' into develop

commit 9779d67b8c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:45:53 2014 +0200

    CallToNameRegistratorOutOfGas balance correction

    Even if execution fails, the value gets transferred.

commit a4f5f45228
Merge: 49a9f47 b6d7cba
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 14:13:12 2014 +0100

    Merge pull request #17 from CJentzsch/develop

    Added A calls B calls A contracts

commit b6d7cba499
Merge: 865cb40 49a9f47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 865cb4083d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:36 2014 +0200

    Added A calls B calls A contracts

commit 49a9f47aec
Merge: 3b0ec43 94a493b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Tue Oct 7 10:56:17 2014 +0200

    Merge pull request #16 from CJentzsch/develop

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 94a493b0d9
Merge: 72853c4 3b0ec43
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:32 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 72853c4382
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:07 2014 +0200

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 3b0ec436e4
Merge: aec3252 222068b
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 05:52:43 2014 +0100

    Merge pull request #15 from CJentzsch/develop

    corrected tests and different style for storage

commit 222068b9ba
Merge: c169653 aec3252
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:28 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit c1696531a6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:09 2014 +0200

    corrected tests and different style for storage

commit aec3252b8e
Merge: 25f9fd5 e17a909
Author: vbuterin <v@buterin.com>
Date:   Mon Oct 6 09:39:46 2014 +0100

    Merge pull request #14 from CJentzsch/develop

    corrected gas limit in vmSystemOperationsTest

commit e17a909f70
Merge: 33fcab5 25f9fd5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:31:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 33fcab5727
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:30:04 2014 +0200

    Bug fix, corrected gasLimit in vmSystemOperationsTest

commit 25f9fd542a
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:47:00 2014 -0400

    one more vm test

commit 2d561a5373
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:15:37 2014 -0400

    separated out vmtests

commit b0c48fa8d6
Merge: cb8261a 6cae166
Author: vbuterin <v@buterin.com>
Date:   Sat Oct 4 17:18:02 2014 +0100

    Merge pull request #13 from CJentzsch/develop

    Added comprehensive EVM test suite. All commands are tested.

commit 6cae166f6f
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 15:34:23 2014 +0200

    Delete tmp.json

commit 4ff906fbc2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 14:06:32 2014 +0200

    corrected CALLSTATELESS tests

commit 5b3fee6806
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 29 13:08:44 2014 +0200

    Completed vm tests. Added ADDMOD, MULMOD, POST, CALLSTATELESS

commit 9cdd218083
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 27 21:48:09 2014 +0200

    Added IOandFlowOperation-, PushDupSwap- and SystemOperations- tests. Removed empty storage from adresses.

commit 28ed968b46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:49:22 2014 +0200

    Added blockInfoTest

commit ffbd5a35b5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:37:52 2014 +0200

    Added environmentalInfo- and sha3- test

commit 54c14f1ff3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 22 13:06:57 2014 +0200

    Added bitwise logic operation test

commit d0af113aab
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 20 01:42:51 2014 +0200

    Added vm arithmetic test

commit cb8261a78b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Sep 19 13:15:44 2014 +0200

    Update genesishashestest.json

commit 4513623da1
Author: Maran <maran.hidskes@gmail.com>
Date:   Tue Jul 22 12:24:46 2014 +0200

    Update keyaddrtest to be valid JSON

commit e8cb5c221d
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 21 23:30:33 2014 -0400

    Added next/prev trie test

commit 98823c04b3
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 14 02:51:31 2014 -0400

    Replaced with deterministic test

commit 357eb21e4d
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun Jul 13 16:12:56 2014 -0400

    Added my own random and namecoin tests (pyethereum)

commit 00cd0cce8f
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jul 12 21:20:04 2014 +0200

    Output hex strings.

commit ddfa3af45d
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 11:28:35 2014 +0100

    Everything a string.

commit d659f469a9
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 10:16:25 2014 +0100

    Code fixes.

commit 5e83ea8228
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 16:17:12 2014 +0200

    Prettier VM tests.

commit a09aae0efe
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 15:46:01 2014 +0200

    Fix VM tests.

commit ec9a044a17
Merge: 4bb6461 5e0123f
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Jul 4 15:56:52 2014 +0200

    Merge pull request #10 from romanman/patch-1

    Update vmtests.json

commit 5e0123fbe1
Author: romanman <roman.mandeleil@gmail.com>
Date:   Fri Jul 4 10:23:04 2014 +0100

    Update vmtests.json

commit 2b6da2f5f2
Author: romanman <roman.mandeleil@gmail.com>
Date:   Thu Jul 3 17:45:04 2014 +0100

    Update vmtests.json

    arith testcase updated

commit 4bb646117d
Merge: bba3898 a33b309
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:22 2014 +0200

    Merge branch 'develop' of github.com:/ethereum/tests into develop

commit bba38980bd
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:06 2014 +0200

    New tests.

commit a33b309d99
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:14:05 2014 -0400

    Testing submodules

commit 50318217ca
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:10:46 2014 -0400

    Testing submodules

commit 57fa655522
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:09:08 2014 -0400

    Testing submodules

commit ea0eb0a8c8
Author: Gav Wood <i@gavwood.com>
Date:   Tue Jul 1 15:19:34 2014 +0200

    Latest genesis block.

commit 25bb76b69c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 13:25:04 2014 +0200

    Reset

commit 74c6d8424e
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 12:10:06 2014 +0200

    Updated wrong test

commit 9ea3a60291
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Sat Jun 28 18:48:28 2014 +0200

    Fixed roots

commit 5fc3ac0e92
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:40:06 2014 +0200

    Simple hex test.

commit edd3a00c2a
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:22:18 2014 +0200

    Additional test for jeff. Now use the 0x... notation.

commit 5021e0dd83
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 21:35:26 2014 +0200

    VM test framework updated.

commit c818d13202
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 18:18:24 2014 +0200

    Removed arrays from Trie tests JSON as per conformance guide and changed
    vocabulary to match other tests.
    VM test updates.

commit 714770ffb3
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jun 11 11:32:42 2014 +0100

    Added Gav's new address.

commit 9345bc13d4
Merge: a2257f3 78576dd
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:38 2014 +0200

    Merge branch 'master' of github.com:ethereum/tests into develop

commit a2257f3471
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:18 2014 +0200

    VM tests.

commit 78576dd3d3
Author: Heiko Heiko <heiko@heiko.org>
Date:   Fri May 30 17:19:09 2014 +0200

    changes based on new account structure nonce, balance, storage, code

commit 125839e848
Merge: 42e14ec 356a329
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu May 22 09:58:45 2014 +0200

    Merge pull request #5 from bkirwi/master

    Fix invalid JSON (removed trailing comma) and add test names

commit 356a3296bc
Author: Ben Kirwin <ben@kirw.in>
Date:   Thu May 22 00:20:48 2014 -0400

    Add some arbitrary test names

    This should now conform to the format specified in the README.

commit 42e14ec54f
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 23:27:40 2014 +0800

    revert to correct data

commit 4300197a74
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:42:23 2014 +0800

    fix: wrong sha3 hash because of the wrong rlp hex

commit a0d01b1a0b
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:29:53 2014 +0800

    fix: wrong rlp hex

commit 6bc2fc7405
Merge: 66bc366 c31a93c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed May 21 14:11:37 2014 +0200

    Merge pull request #4 from ethers/master

    fix file name that seems to have been a typo

commit c31a93c27a
Author: ethers <ethereum@outlook.com>
Date:   Tue May 20 15:42:39 2014 -0700

    fix file name that seems to have been a typo

commit 66bc3665c1
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:36:35 2014 +0200

    fix: represent integers as strings

commit ede5499da6
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:21:09 2014 +0200

    add: current initial alloc and genesis hashes

commit 5131429abb
Author: Ben Kirwin <ben@kirw.in>
Date:   Mon May 19 11:18:31 2014 -0400

    Delete a comma

    This should now be parseable as JSON.

commit f44a859331
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Sun May 18 15:04:42 2014 +0800

    add: case when value is long, ensure it's not get rlp encoded as node

commit e1ae4ad449
Author: Gav Wood <i@gavwood.com>
Date:   Mon May 12 14:40:47 2014 +0100

    PoC-5 VM tests.

commit 2b6c136dda
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun May 11 21:42:41 2014 -0400

    Moved txt to json

commit cbccbf977c
Merge: edbb8d4 45a0974
Author: Vitalik Buterin <v@buterin.com>
Date:   Thu May 8 21:54:48 2014 -0400

    New commit

commit edbb8d407e
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue May 6 16:53:43 2014 -0400

    Removed unneeded test, added new tests

commit 45a0974f6f
Merge: 15dd8fd 5fd2a98
Author: Gav Wood <i@gavwood.com>
Date:   Sun Apr 27 12:53:47 2014 +0100

    Merge pull request #3 from autolycus/develop

    Fixed formatting and added test cases

commit 5fd2a98fcb
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 13:26:14 2014 -0700

    Added some new test cases for the rlp encoding.

commit 4ba150954e
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 12:48:42 2014 -0700

    Converted spaces to tabs to be compliant with the coding standards defined in cpp-ethereum

commit 15dd8fd794
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 12:54:47 2014 +0000

    RLP tests and Trie updates.

commit 33f80fef21
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:39:35 2014 +0000

    Hex encode tests done.

commit e1f5e12abb
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:22:49 2014 +0000

    Fix RLP tests.

commit f87ce15ad2
Author: Gav Wood <i@gavwood.com>
Date:   Thu Feb 27 13:28:11 2014 +0000

    Fix empty string.

commit c006ed4ffd
Author: Gav Wood <i@gavwood.com>
Date:   Mon Feb 24 10:24:39 2014 +0000

    Tests fix.

commit 510ff56363
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:54:08 2014 +0000

    Updated the tests.

commit a0ec843832
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:49:24 2014 +0000

    Moved over to new format, but RLP tests still need updating.

commit 660cd26f31
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:35:51 2014 +0000

    More docs.

commit 6ad14c1a15
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:33:39 2014 +0000

    Added VM test suite.
    Added TODO.
    Renamed old files.

commit f91ad7b385
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 11:26:58 2014 -0500

    update trie algorithm

commit 6da2954462
Merge: cc42246 131c610
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 08:15:38 2014 -0500

    merge

commit cc4224675f
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Jan 7 14:35:26 2014 -0500

    Updated trie test

commit 131c610da6
Merge: 121632b 7613302
Author: vbuterin <v@buterin.com>
Date:   Wed Jan 1 06:40:54 2014 -0800

    Merge pull request #1 from obscuren/master

    Update trietest.txt

commit 7613302b49
Author: obscuren <obscuren@users.noreply.github.com>
Date:   Wed Jan 1 15:25:21 2014 +0100

    Update trietest.txt

    New proposed explanatory format

commit 121632bedd
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 1 08:26:18 2014 -0500

    Added obscure's tests

commit ef6c5506c3
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 19:04:48 2013 -0500

    Fixed tests a bit

commit 345e4bcfef
Merge: 2c81698 e4bbea4
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 15:52:46 2013 -0500

    Merge branch 'master' of github.com:ethereum/tests

commit 2c81698f31
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Dec 30 21:09:40 2013 -0500

    Added first three tests

commit e4bbea400f
Author: vbuterin <v@buterin.com>
Date:   Mon Dec 30 18:09:03 2013 -0800

    Initial commit
2014-12-12 11:34:27 +01:00
d899334bba Merge pull request #1 from Gustav-Simonsson/fix_reference_links
Update reference pdf links
2014-12-11 23:30:45 +01:00
ce796dcdbf Update reference pdf links 2014-12-11 13:25:01 +01:00
2b5fcb4642 moved interfaces 2014-12-10 20:26:55 +01:00
5553e5aaed states moved to chain 2014-12-10 19:59:12 +01:00
af6afbaa56 Removed start/stop methods 2014-12-10 16:48:39 +01:00
1b98cbbfa4 Moved pow 2014-12-10 16:45:16 +01:00
3e38f8af23 initial commit for eth blockpool + test 2014-12-10 14:51:47 +00:00
e74f9f27db eth protocol changes
- changed backend interface
- using callbacks for blockPool
- use rlp stream for lazy decoding
- use peer as logger
- add id (peer pubkey) to ethProtocol fields
- add testPeer to protocol test (temporary)
2014-12-10 14:51:47 +00:00
31a9fdced8 no logging in error (to be refactored into p2p) 2014-12-10 14:51:47 +00:00
47793b606c initial commit for eth-p2p integration 2014-12-10 14:51:47 +00:00
4082c8b61d added simple peer server 2014-12-10 15:29:22 +01:00
dda778eda7 Updated whisper messages to new crypto api + added tests 2014-12-10 14:17:32 +01:00
0f5c6c5e2d Changed new methods to use ecdsa package for pub prv keys 2014-12-10 14:17:10 +01:00
186948da22 changed to unsigned integers 2014-12-10 11:27:10 +01:00
4f1ef89cb2 updated tests 2014-12-10 11:04:21 +01:00
1fb84d3c5f Fixed tests 2014-12-10 10:57:19 +01:00
3308491c92 Removed tests because they've become obsolete 2014-12-10 00:09:32 +01:00
9ff7be68fb Merge branch 'poc8' into develop 2014-12-10 00:06:38 +01:00
ce0c4e5d86 Merge pull request #203 from fjl/rlp-fixes
RLP: remove signed integer support and other fixes
2014-12-10 00:06:17 +01:00
984c7e6689 Added encryption for messages better API for sealing messages 2014-12-10 00:03:50 +01:00
87adff7e18 Added Encrypt & Decrypt using the ECIES w/ tests 2014-12-10 00:03:21 +01:00
c24018e273 Added S256 curve 2014-12-10 00:02:43 +01:00
6cf6981ed0 init 2014-12-10 00:00:52 +01:00
6cf4e0329c rlp: display decoder target type in more error messages
Decode error messages now say "expected input list for foo.MyStruct"
instead of just "expected List".
2014-12-09 22:28:49 +01:00
df5157c0b0 PV49 2014-12-09 20:28:36 +01:00
acf4b5753f Core changes
* Code = '' if gas < len(D) * 5
* Sha3 gas   10 + 10 * len(D), rounding up 32 bytes
* Sha256 gas 50 + 50 * len(D), rounding up 32 bytes
* Ripmed gas 50 + 50 * len(D), rounding up 32 bytes
* Accounts and value transfers no longer reverted
2014-12-09 20:27:57 +01:00
829730dec4 rlp: remove dead code 2014-12-09 12:49:20 +01:00
c084a7daa5 rlp: fix panic in decodeList on go 1.4+
The documentation for reflect.Value.Index states that it will
panic for out-of-bounds indices. Since go 1.4, it actually panics.
2014-12-09 10:58:46 +01:00
93e858f88e rlp: remove support for signed integer types
There is no agreement on how to encode negative integers
across implementations. cpp-ethereum doesn't support them either.
2014-12-09 10:58:46 +01:00
4f12f0697e rlp: move decoder type switch to decode.go 2014-12-09 10:52:05 +01:00
76842b0df8 Additional checks and debug output 2014-12-08 14:25:52 +01:00
e3a8412df3 Proper start/stoping wpeers 2014-12-08 13:16:50 +01:00
ebe2d9d872 First draft of Whisper messages relaying 2014-12-08 12:43:33 +01:00
f06543fd06 Merge branch 'poc8' into develop 2014-12-05 16:27:48 +01:00
195b2d2ebd Merge branch 'fjl-feature/p2p-protocol-interface' into poc8 2014-12-05 16:27:37 +01:00
384b8c75f0 Merge branch 'feature/p2p-protocol-interface' of https://github.com/fjl/go-ethereum into fjl-feature/p2p-protocol-interface 2014-12-05 16:27:11 +01:00
9925916851 upped proto version and modified block pool 2014-12-05 16:26:39 +01:00
095cb97675 EXP simplified 2014-12-05 14:52:36 +01:00
d80f8bda94 Fixed issue in VM where LOG didn't pop anything of the stack 2014-12-05 12:32:47 +01:00
3cf0477c21 Merge branch 'poc8' into develop 2014-12-04 23:54:40 +01:00
8dbca75d85 Skip mining on transactions that don't meet the min accepted gas price 2014-12-04 23:54:07 +01:00
710360bab6 Merge pull request #199 from ethereum/tests
Submit code coverage to coveralls only on travis build success
2014-12-04 23:00:12 +01:00
3db9c80070 Removed mutan. Closes #183 2014-12-04 17:13:23 +01:00
085f604b27 Show newly created private key during startup. Closes #126 2014-12-04 17:09:47 +01:00
a5b27bbc10 Improved and simplified wallet functions and behaviour 2014-12-04 16:44:43 +01:00
8c7e4b290f Added pre processing of transaction on the transient state 2014-12-04 16:44:14 +01:00
5653898150 vim error :S 2014-12-04 15:38:41 +01:00
73123bf257 Only set TD if it's actually higher 2014-12-04 15:35:21 +01:00
73c4ca3a6f Upped protocol version 2014-12-04 15:31:48 +01:00
296112848c Moved block validation as first step 2014-12-04 15:13:29 +01:00
008e91db6a null ptr fix 2014-12-04 12:43:12 +01:00
3043b233ea Log is now interface 2014-12-04 12:35:23 +01:00
bff5999efa sort tests for evm 2014-12-04 12:09:22 +01:00
f298ffdbb8 Renamed State => StateDB 2014-12-04 11:40:20 +01:00
3664cd58e3 Updated testing tools 2014-12-04 11:30:41 +01:00
491edc16e7 Fixes #189 2014-12-04 10:57:09 +01:00
83663ed4b0 Renames for chain, updated VM, moved methods
* Renamed a couple more chain => core
* Updated VM `pc` to be uint64 rather than big int
* XEth interface cleanup
2014-12-04 10:53:49 +01:00
9008b155d3 Renamed chain => core 2014-12-04 10:28:02 +01:00
b6cb5272de Descriptive function names for closure getters 2014-12-03 17:35:57 +01:00
6d99c03d91 Updated environments according to the new interface set 2014-12-03 17:22:26 +01:00
99853ac3ce Moved execution from vm to chain.
This moves call and create to the specified environments. Vms are no
longer re-used. Vm uses environment's Call(Code) and Create in order to
execute new contracts or transfer value between accounts.

State transition now uses the same mechanism described above.
2014-12-03 17:06:54 +01:00
8240550187 updated to types 2014-12-03 14:05:19 +01:00
709eff4ea7 reverted vm back 2014-12-03 13:52:30 +01:00
6212175be3 reverted vm back 2014-12-03 13:52:13 +01:00
6095edac58 merge 2014-12-03 13:50:51 +01:00
3d9a4e7084 Fixed mem error in vm. Fixed logs tests 2014-12-03 12:21:12 +01:00
f778922086 Set proper message value 2014-12-02 22:37:45 +01:00
edc52bdcbf Updated value for mined blocks. Closes #197 2014-12-02 22:23:20 +01:00
0a22dc2ce5 Check coinbase for from/to inclusion 2014-12-02 22:22:43 +01:00
cb4d168ecc Updated LOG to match proper gas in all cases 2014-12-02 17:22:33 +01:00
5ebae82eeb Additional logging and removed temp merged mining options. 2014-12-02 12:23:27 +01:00
64f35ba8d1 merge errors fixed 2014-12-02 11:52:56 +01:00
99481a245a Check for known block err and ignore 2014-12-02 11:37:33 +01:00
9f7a8ea5e6 updated tests 2014-12-02 10:29:39 +01:00
b4eeffa8f1 Transaction strictness 2014-12-02 00:14:34 +01:00
2df8ad6307 Added state tests 2014-12-02 00:03:53 +01:00
a052357872 Fixed EXP gas 2014-12-01 22:05:38 +01:00
a22056db59 Make an attempt to pay for the gas prior to expanding the mem. 2014-12-01 20:49:56 +01:00
beb7d35c40 Updated tests 2014-12-01 20:21:41 +01:00
d33987cb44 Additional fees for *COPY 2014-12-01 20:20:55 +01:00
6dc46d3341 Changed the way transactions are being added to the transaction pool 2014-12-01 20:18:09 +01:00
616066a598 rework vm 2014-11-30 21:02:59 +01:00
7c24cd790d fix panic on bad sender 2014-11-28 19:42:05 -05:00
1bce02eff7 Fixed merge 2014-11-28 21:44:34 +01:00
a3559c5e1b updated PV 2014-11-28 21:38:10 +01:00
c8d0f8adc5 Changed refund 2014-11-28 21:20:32 +01:00
6ba8328077 Removed min gas price from genesis 2014-11-28 20:57:10 +01:00
61556ef01d GasData changes & removed min gas price 2014-11-28 20:47:24 +01:00
ef7961b7d2 Merge pull request #194 from ethereum/poc8
Update tests branch to PoC8
2014-11-27 13:23:31 +01:00
c17a3cb0ce chain coverage report & submission
prevent coverage results from being submitted to coveralls if when the
build fails
2014-11-27 12:42:13 +01:00
cfd7e74c25 p2p: add test for NewPeer 2014-11-26 22:49:40 +01:00
3a09459c4c p2p: make Disconnect not hang for peers created with NewPeer 2014-11-26 22:08:54 +01:00
9b85002b70 p2p: remove Msg.Value and MsgLoop 2014-11-25 16:01:39 +01:00
f816fdcb69 rlp: include target type in decoder error messages 2014-11-25 16:00:48 +01:00
6049fcd52a p2p: use package rlp for baseProtocol 2014-11-25 12:25:31 +01:00
c1fca72552 p2p: use package rlp 2014-11-24 19:03:20 +01:00
205af02a1f rlp: add NewListStream (for p2p) 2014-11-24 19:03:17 +01:00
5a5560f105 rlp: add Stream.Reset and accept any reader (for p2p) 2014-11-24 19:03:11 +01:00
59b63caf5e p2p: API cleanup and PoC 7 compatibility
Whoa, one more big commit. I didn't manage to untangle the
changes while working towards compatibility.
2014-11-21 21:52:45 +01:00
e4a601c644 p2p: disable failing Server tests for now 2014-11-21 21:52:45 +01:00
7149191dd9 p2p: fix issues found during review 2014-11-21 21:52:45 +01:00
f38052c499 p2p: rework protocol API 2014-11-21 21:52:45 +01:00
4cd9d57bad Merge pull request #187 from honestmoney/develop
Fix for broken develop build and install.sh
2014-11-21 13:22:14 -05:00
8cf9ed0ea5 Fixed test 2014-11-21 10:48:07 -05:00
28b7dcc204 go get deps doesnt work with develop branch 2014-11-21 08:16:32 -05:00
eba3fca7bc go get dependencies on executable 2014-11-21 08:05:52 -05:00
6c098ee779 changed install.sh to change branch and install executable 2014-11-21 00:06:33 -05:00
c0bbb7e69a fix for install script devel 2014-11-20 15:02:24 -05:00
d5ac24907e Updated install.sh - github paths for executables 2014-11-20 14:25:26 -05:00
0f47129113 Updated main.go - fix for broken develop build
Transaction execution fixes - 60cdb1148c
2014-11-20 14:16:22 -05:00
9b8a12b4b5 Removed naively casting to bytes 2014-11-20 18:20:04 +01:00
12f1aea38d Fixed iterator for short nodes.
In some cases the iterator didn't properly return the correct key
because it didn't append fields to the reverse lookup.
2014-11-20 18:11:31 +01:00
b05e63c34d Added paranoia check for tries 2014-11-19 16:56:01 +01:00
cab7e6000e Increased coverage 2014-11-19 16:35:57 +01:00
0f460ad26e Added caching and database interface to trie
* Reimplemented caching for trie
* Reimplemented resetting and persisting trie
2014-11-19 16:21:28 +01:00
e70529a977 Added new iterator and tests 2014-11-19 15:05:08 +01:00
14e2e488fd Added chain tests & minor fixes
* Fork tests (equal and larger chains)
* `chain.link` fields are now exported
* moved debug function from state to dump.go
2014-11-19 12:25:52 +01:00
437d79f094 Updated readme 2014-11-18 20:23:17 +01:00
93e693be72 Fixed tests for 'types' 2014-11-18 19:52:45 +01:00
675ba4d7eb Merge branch 'tests' into poc8 2014-11-18 19:48:35 +01:00
f8d0cd9906 Added a callback mechanism to chain adding.
Not sure if this is the right approach. Why? BlockChain shouldn't need
the "Ethereum" object. BlockChain shouldn't need to worry about
notifying listeners or message propagation.
2014-11-18 19:44:17 +01:00
a1b6a9ac29 Begin of moving objects to types package
* Block(s)
* Transaction(s)
2014-11-18 16:58:22 +01:00
b402484e41 common changes 2014-11-18 13:59:17 +01:00
62cd9946ee j => i 2014-11-18 12:20:14 +01:00
e08aba5dd9 added output test 2014-11-18 12:18:27 +01:00
34f29d57b6 Update vm_debug.go 2014-11-18 12:03:51 +01:00
3220a32ff0 Added some comparison tests for the new ptrie 2014-11-18 12:03:09 +01:00
f7417d3552 New modified patricia trie 2014-11-18 12:02:13 +01:00
04845d42c0 Merge pull request #1 from cubedro/master
Fixed autoprovider bug
2014-11-18 09:08:15 +01:00
0d526d66b7 Updated version
Changed version from npm in order to publish the update
2014-11-18 09:23:16 +02:00
8fe16df6c9 Merge pull request #11 from debris/master
Update
2014-11-18 09:21:06 +02:00
1a9624af51 Fixed require web3 bug
Fixed error "Cannot find module './web3'" in autoprovider.js
2014-11-18 09:11:16 +02:00
8b7e59729f Merge pull request #10 from debris/abi
Abi
2014-11-18 09:00:01 +02:00
5c958ec5f6 Undo running go vet in travis 2014-11-17 10:53:24 -06:00
2a5af8fac7 enable go vet 2014-11-17 10:40:40 -06:00
559a81da6f enable golint 2014-11-17 10:21:19 -06:00
27a8799e48 added eth_serpent, contract separated to another file 2014-11-17 15:46:46 +01:00
a19d2c2278 Merge branch 'develop' into refactor 2014-11-17 12:14:05 +01:00
cad770c734 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-11-17 12:13:11 +01:00
ca74bcc4cd cleaning up 2014-11-17 12:12:55 +01:00
b4e47a094c Merge pull request #184 from fjl/feature/rlp
rlp: new package for streaming RLP decoder
2014-11-17 03:12:18 -08:00
bd0a50fdc3 rlp: fix pointer reuse 2014-11-17 12:02:08 +01:00
74266d5bbd rlp: new package for streaming RLP decoder 2014-11-17 01:49:47 +01:00
9095b37343 Convert vm test to checker
Tests are skipped due to reliance on deprecated mutan
2014-11-16 13:45:46 -06:00
ffab36c7d8 Update ethutil/common tests to checker 2014-11-16 12:08:27 -06:00
f82fb889b7 Add goveralls to travis builds 2014-11-16 08:34:28 -06:00
ddca18638f update imports order per goimports 2014-11-15 20:21:55 -06:00
3588c4a9fe formatting update per gofmt 2014-11-15 20:21:03 -06:00
71b338e8ac update travis steps 2014-11-15 19:45:05 -06:00
58812fad42 Reorg travis.yml 2014-11-15 19:36:30 -06:00
790ded0f47 Update travis deps script 2014-11-15 19:11:43 -06:00
6dbd7a9a80 add websocket to deps 2014-11-15 18:59:56 -06:00
e1e50f4afd add go cover to install list 2014-11-15 18:54:26 -06:00
3a656c07f1 add go-nat-pmp to manual install list 2014-11-15 18:49:18 -06:00
ec75119341 Update deps script 2014-11-15 18:42:48 -06:00
0b64906a72 Add -y flags 2014-11-15 18:28:09 -06:00
1beb9a2b8b update apt repos 2014-11-15 18:22:01 -06:00
242667ebe5 update travis build deps 2014-11-15 18:12:50 -06:00
5211fb0c79 make script executable 2014-11-15 17:56:16 -06:00
81e7f8679e script fix 2014-11-15 17:51:58 -06:00
6f7f570670 custom travis build script
Based on https://github.com/daaku/go.travis/blob/master/install
2014-11-15 17:45:08 -06:00
8f9a354682 try to fix travis dep error 2014-11-15 09:07:02 -06:00
bc5d924b83 more travis changes 2014-11-14 22:23:31 -06:00
9481f86c37 run coverage after build 2014-11-14 22:17:01 -06:00
dd9e99a418 try to get full coverage report on travis 2014-11-14 20:58:09 -06:00
33afb10b0d clean up 2014-11-15 00:29:27 +01:00
1ecb3b4cf3 Remove failing Printf 2014-11-14 15:53:45 -06:00
dcd8cc8341 added test file to root directory 2014-11-14 15:31:15 -06:00
e6e468ef59 Merge branch 'develop' of https://github.com/tgerring/go-ethereum into tests
Conflicts:
	p2p/messenger_test.go
	trie/trie_test.go
2014-11-14 15:19:50 -06:00
2a9fc7baa9 Merge branch 'develop' of https://github.com/tgerring/go-ethereum 2014-11-14 15:01:52 -06:00
f6ee8e52dd Merge pull request #13 from frewsxcv/master
Enable JSHint linting
2014-11-14 20:24:55 +01:00
08f2dde45a Enable JSHint linting 2014-11-14 14:00:19 -05:00
42713c6e99 Merge pull request #12 from debris/master
simplifie contract creation && calls, improved added examples
2014-11-14 17:20:05 +01:00
7ffba22f2d Merge pull request #10 from cubedro/master
NPM module with minification for browser integration.
2014-11-14 17:16:28 +01:00
60198a05b9 Merge pull request #11 from ethereum/revert-6-master
Revert "Run JSHint on all code using Travis CI"
2014-11-14 17:08:47 +01:00
6b8b1259e2 Revert "Run JSHint on all code using Travis CI" 2014-11-14 17:08:29 +01:00
c966a5c17e Merge pull request #6 from frewsxcv/master
Run JSHint on all code using Travis CI
2014-11-14 17:07:38 +01:00
56aa24002d Clean up 2014-11-14 14:17:54 +01:00
711be7009e Version bump 2014-11-14 13:51:41 +01:00
f6e55962a8 Fixes for PV41/42
* Don't expand mem on empty value
* Removed all coinbase logs for PV42
* Removed C++ bug stuff for LOG*
2014-11-14 13:47:12 +01:00
ea8db7a4ae improved contracts interface 2014-11-14 13:11:47 +01:00
8aaec1d98f improved example 2014-11-13 19:28:58 +01:00
b1428555d1 added storageAt 2014-11-13 18:29:31 +01:00
20d518ee95 Numerous fixes for consensus.
* Removed (buged) C++ specific gas specification for LOG*
* Fixed LOG* where mstart went after msize
*
2014-11-13 18:12:12 +01:00
0e67fcd361 contract object 2014-11-13 12:24:34 +01:00
313cfba7d4 convert trie encoding tests to checker 2014-11-13 04:40:21 +01:00
d99fea2db6 abi output formatting 2014-11-13 04:21:51 +01:00
461324a801 Remove references to mutan
obscuren/mutan is deprecated
2014-11-12 22:08:56 +01:00
fa59db7595 Add initial state/TestDump test 2014-11-12 22:03:03 +01:00
bd9bd4abed Reorg state tests 2014-11-12 22:02:39 +01:00
6eacc8eab9 eth-go -> go-ethereum 2014-11-12 21:52:37 +01:00
00878e5b6e Convert trie tests to gocheck 2014-11-12 21:43:25 +01:00
7ce63d32b2 qt version also requires abi 2014-11-12 20:56:21 +01:00
3451f26086 changes to make everything work 2014-11-12 20:39:13 +01:00
05290d5547 abi, the beginning 2014-11-12 18:59:29 +01:00
60cdb1148c Transaction execution fixes 2014-11-12 01:36:36 +01:00
9bb1ac7564 Fixes for the log method 2014-11-11 23:14:22 +01:00
6c9e503eb8 Removed all implicit logging. Fixed gas issues and jump errors 2014-11-11 22:52:27 +01:00
1d866b5e57 Merge pull request #1 from tgerring/tests
Initial tests based on check framework
2014-11-11 20:37:18 +01:00
5c5df21e3d Update TestDeleteFromByteSlice
Still broken
2014-11-11 20:05:27 +01:00
12e8404f8f Fix TestBytestoNumber 2014-11-11 20:04:03 +01:00
0d1cdd26d6 Update TestNumberToBytes 2014-11-11 20:03:50 +01:00
cff0d93105 Converts bytes_test to checker 2014-11-11 19:38:23 +01:00
c24d143c9e Convert rand_test to checker 2014-11-11 19:18:52 +01:00
bfd1fe977e Update test style to checker 2014-11-11 19:05:35 +01:00
d9ccbf04db Move test bootstrap to main_test.go 2014-11-11 19:05:23 +01:00
dc100f85b3 Merge pull request #9 from debris/autoprovider
common fixes
2014-11-11 17:31:04 +02:00
0316490c54 common fixes 2014-11-11 16:29:53 +01:00
d85cef557b Merge pull request #8 from debris/autoprovider
Autoprovider
2014-11-11 17:20:53 +02:00
838ca2fd93 autoprovider, buildQt not builds only necessery files, fixed gulpfile 2014-11-11 15:47:58 +01:00
cd94b5ffb3 Convert value_test to use gocheck 2014-11-11 15:04:11 +01:00
3c619baec5 Add verbose comments to TestSnapshot 2014-11-11 13:07:24 +01:00
8f3a03c0cc Update state tests to use gocheck 2014-11-11 12:52:43 +01:00
75ee3b3f08 debugging code 2014-11-11 12:16:36 +01:00
84b36a7193 retabed files 2014-11-11 11:46:46 +01:00
dea68f073e Merge branch 'debris-subprotocol_prefix_merge' 2014-11-11 12:15:36 +02:00
7af9cc70d0 fixed merge conflicts 2014-11-11 12:11:06 +02:00
4b876168f4 gulp qt task 2014-11-11 10:45:38 +01:00
d92a7527db merged subprotocol prefix 2014-11-11 10:30:21 +01:00
720365859c Changed npm & bower version
Changed version for next npm publish
2014-11-10 15:26:10 +02:00
d95e2b7999 Fixed jshint warnings 2014-11-10 14:53:35 +02:00
9509322ecd Updated readme 2014-11-10 13:36:53 +01:00
6fc5d8e81e Prepare for PR
changed repo urls from package.json, bower.json and readme
2014-11-10 14:31:53 +02:00
bed659f9b3 Moved ethtest to cmd 2014-11-10 13:31:18 +01:00
ad0acb5762 Moved messages eventing to chain manager 2014-11-10 13:27:24 +01:00
67e3eff806 Merge pull request #6 from cubedro/develop
Changes from debris
2014-11-10 14:10:25 +02:00
f5024b4926 Merge pull request #5 from cubedro/debris-error_handling_fix
Debris error handling fix
2014-11-10 14:09:21 +02:00
c1b2595deb fix merge conflicts 2014-11-10 14:07:06 +02:00
512d4ca6a4 Merge branch 'debris-error_handling_fix' into develop 2014-11-10 14:00:02 +02:00
c91e4afe6c fix merge conflicts 2014-11-10 13:57:49 +02:00
ebb7db263f Added dumps 2014-11-10 12:42:16 +01:00
d30571a7a8 Added VM testing tool 2014-11-10 11:47:37 +01:00
cbeebcd47d Fixed bloom, updated mining & block processing
* Reverted back to process blocks in batches method
* Bloom generation and lookup fix
* Minor UI changed (mainly debug)
2014-11-10 01:17:31 +01:00
f538ea25e4 Fixed bug on gas and setting of receipts and roots 2014-11-09 23:59:25 +01:00
a2d8b89289 Added npm version 2014-11-09 21:30:27 +02:00
8ca991ecd2 corresponding changes from cpp-ethereum 2014-11-07 14:36:07 +01:00
e3ad9be4c8 missing semicolons 2014-11-07 14:07:01 +01:00
0d6479e1d6 proper error handling proposal 2014-11-07 14:03:46 +01:00
429dd2a100 Implemented new miner w/ ui interface for merged mining. Closes #177
* Miner has been rewritten
* Added new miner pane
* Added option for local txs
* Added option to read from MergeMining contract and list them for
  merged mining
2014-11-07 12:18:48 +01:00
3270b432bc Refactoring
Removed browser fixes
Updated gulp to bypass native browser objects
Added source map for dist
2014-11-06 22:51:37 +02:00
0a3a148ed4 Added more byte tests 2014-11-06 12:35:46 +01:00
bd14b4d23e node < 0.10 fails travis build => remove 0.6 & 0.8
from travis.yml
2014-11-06 01:48:52 +02:00
4402a7d817 gulp >= 3.4.0 2014-11-06 00:49:50 +02:00
5871d1e359 Updated all dependency versions 2014-11-06 00:44:40 +02:00
2f33a8c657 Update dependencies to pass travis build 2014-11-06 00:37:07 +02:00
6dc7be6cd1 Update dependencies & travis.yml 2014-11-06 00:24:10 +02:00
7d6164b351 updated travis.yml 2014-11-05 23:31:54 +02:00
48a3f0986c Add coverage for rand 2014-11-05 22:21:28 +01:00
a1d62abca4 Restructure StorageSize string test 2014-11-05 22:16:44 +01:00
44ab30f628 more json fixes 2014-11-05 23:07:13 +02:00
be96da179a Added tests for FormatData 2014-11-05 22:01:41 +01:00
8f94f731a5 Reorder tests to match source order 2014-11-05 22:01:09 +01:00
ab6b9c44aa Added test for IsHex 2014-11-05 22:00:01 +01:00
4e15adac6d Remove fmt dependency 2014-11-05 21:59:22 +01:00
dcae30c1e4 updated bower.json ignore 2014-11-05 22:58:06 +02:00
f281a362f0 bower small fix 2014-11-05 22:37:00 +02:00
c402dad6fa Updated bower.json & Readme 2014-11-05 22:33:28 +02:00
45d0d72138 Updated package.json 2014-11-05 20:12:21 +02:00
15088d7ebe Fixed indent
Fixed indent so we can compare differences in PR.
2014-11-05 19:52:52 +02:00
4be4db5e6c Converted to node module
Converted to npm package
Added brower
Added browserify with minification
Updated Readme
2014-11-05 19:46:01 +02:00
b100546c9d add test for Bytes.String() 2014-11-05 18:02:20 +01:00
834f8a1dc8 added test for CopyBytes 2014-11-05 17:48:23 +01:00
ada684e054 added test for BinaryLength 2014-11-05 17:44:28 +01:00
92b30cc452 add tests for ReadVarInt 2014-11-05 17:39:26 +01:00
cb32f52b9c added test for parsing bytes 2014-11-05 17:11:40 +01:00
4f00929084 Added byte padding tests 2014-11-05 17:04:24 +01:00
94b0ce84da Cleanup big_test.go 2014-11-05 13:35:43 +01:00
e76c58d175 New test coverage for ethutil/big.go 2014-11-05 13:23:50 +01:00
92299b7c24 New test coverage for ethutil/path.go 2014-11-05 11:23:30 +01:00
48488017e4 Proper packages 2014-11-05 00:34:59 +01:00
b4da085a9f Accidental packages 2014-11-05 00:34:04 +01:00
7db44b56b0 Updated to ethereum serpent 2014-11-05 00:32:51 +01:00
3e174a0879 Merge pull request #1 from cubedro/example
example
2014-11-04 21:26:14 +02:00
99d5769c2b There'll be jumping in to jumps 2014-11-04 18:38:19 +01:00
1b1fa049fa Fixed VM and added static analysis for EVM jumps 2014-11-04 18:18:57 +01:00
8cfbf1836d Added JUMP analysis (WIP) 2014-11-04 18:17:38 +01:00
78fb2af6f1 Squashed commit of the following:
commit 79d7cbfc4a
Merge: 9120274 1c1ba8d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:32:11 2014 +0100

    Merge remote-tracking branch 'origin/develop' into develop

commit 9120274a46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:31:27 2014 +0100

    Update tests to latest protocol changes (PoC7)

commit 1c1ba8d161
Merge: 014d370 3aebe53
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Nov 4 13:30:52 2014 +0100

    Merge pull request #31 from CJentzsch/develop

    Restructered tests in folders in accordance to test suites

commit 3aebe532e5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:58:21 2014 +0100

    Updated vmNamecoin.json to new sstore prices

commit 8a0be21839
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:53:00 2014 +0100

    Added example state test

commit 83643addbc
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:36:25 2014 +0100

    removed systemoperationstests

commit 3930ca3a9a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Nov 3 13:22:15 2014 +0100

    Restructered tests in folders in accordance to test suites

commit 014d370b5d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 21:23:56 2014 +0100

    New SIGNEXTEND tets

commit 155d449be2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 29 20:59:05 2014 +0100

    New tests for BNOT and SIGNEXTEND

commit c9eae764b8
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 28 12:58:27 2014 +0100

    Update SSTORE gas cost and BNOT instead of NEG

commit ad2a75ac58
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 16:05:49 2014 +0200

    Added new recursive bombs

commit 834c52af64
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Thu Oct 23 12:01:05 2014 +0200

    Changing gas cost to zero at stackunderflow

commit c73a8a89d2
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed Oct 22 13:04:45 2014 +0200

    Reverted back to original value.

commit b9a8c92422
Author: martin becze <wanderer@users.noreply.github.com>
Date:   Tue Oct 21 17:02:52 2014 -0400

    fix spelling error

commit b48ae74af4
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:26:26 2014 +0200

    Added failing random tests

commit bee0a4100c
Merge: 5050d20 b315da6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 21 17:15:05 2014 +0200

    Merge remote-tracking branch 'origin/master' into develop

commit 5050d20b4d
Merge: 7516685 ba35362
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 20 20:18:20 2014 +0200

    Merge pull request #26 from wanderer/develop

    Add a package.json for node.js

commit ba35362876
Author: wanderer <mjbecze@gmail.com>
Date:   Sun Oct 19 23:59:47 2014 -0400

    turned tests into a node module

commit 751668571e
Author: ethers <ethereum@outlook.com>
Date:   Thu Oct 16 17:08:20 2014 -0700

    json was invalid and missing quotes

commit 0e687cee47
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu Oct 16 17:13:24 2014 +0200

    Update vmEnvironmentalInfoTest.json

commit 78a78e2e6c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 15 14:19:11 2014 +0200

    updated genesis_hash

commit b315da618b
Merge: 7a7e198 0a76a3a
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 14 10:33:26 2014 +0200

    Merge pull request #23 from ethers/fix22

    numbers should be strings #22

commit 0a76a3a312
Author: ethers <ethereum@outlook.com>
Date:   Mon Oct 13 14:45:30 2014 -0700

    numbers should be strings #22

commit 1f67385f13
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:18:00 2014 +0200

    Added some MUL tests

commit 7a7e198395
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 13:11:59 2014 +0200

    Added some MUL tests

commit 46eb6283ae
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Oct 11 12:18:13 2014 +0200

    tested new opcodes (JUMPDEST,CALLCODE) and created test for CALL/CREATE depth

commit 8d38d62d10
Author: Nick Savers <nicksavers@gmail.com>
Date:   Fri Oct 10 18:09:41 2014 +0200

    INVALID stops the operation and doesn't cost gas

commit ed6eba7c8e
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 19:08:48 2014 +0200

    Update + ABA recursive bomb which needs maximum recursion limit of 1024

commit 2d72050db1
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 14:37:18 2014 +0200

    Applied recent protocol changes (PoC7) to existin tests

commit dfe66cab3f
Merge: 4513623 1a67a96
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 8 11:05:51 2014 +0200

    Merge remote-tracking branch 'origin/develop'

    Conflicts:
    	genesishashestest.json

commit 1a67a96cff
Merge: a4f5f45 ffd6bc9
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 15:10:23 2014 +0100

    Merge pull request #18 from CJentzsch/develop

    CallToNameRegistratorOutOfGas balance correction

commit ffd6bc97ad
Merge: a4f5f45 9779d67
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:47:34 2014 +0200

    Merge remote-tracking branch 'origin/develop' into develop

commit 9779d67b8c
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:45:53 2014 +0200

    CallToNameRegistratorOutOfGas balance correction

    Even if execution fails, the value gets transferred.

commit a4f5f45228
Merge: 49a9f47 b6d7cba
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 14:13:12 2014 +0100

    Merge pull request #17 from CJentzsch/develop

    Added A calls B calls A contracts

commit b6d7cba499
Merge: 865cb40 49a9f47
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 865cb4083d
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 15:02:36 2014 +0200

    Added A calls B calls A contracts

commit 49a9f47aec
Merge: 3b0ec43 94a493b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Tue Oct 7 10:56:17 2014 +0200

    Merge pull request #16 from CJentzsch/develop

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 94a493b0d9
Merge: 72853c4 3b0ec43
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:32 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 72853c4382
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Oct 7 10:51:07 2014 +0200

    corrected amount of used gas for CallToNameRegistratorOutOfGas

commit 3b0ec436e4
Merge: aec3252 222068b
Author: vbuterin <v@buterin.com>
Date:   Tue Oct 7 05:52:43 2014 +0100

    Merge pull request #15 from CJentzsch/develop

    corrected tests and different style for storage

commit 222068b9ba
Merge: c169653 aec3252
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:28 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit c1696531a6
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 21:17:09 2014 +0200

    corrected tests and different style for storage

commit aec3252b8e
Merge: 25f9fd5 e17a909
Author: vbuterin <v@buterin.com>
Date:   Mon Oct 6 09:39:46 2014 +0100

    Merge pull request #14 from CJentzsch/develop

    corrected gas limit in vmSystemOperationsTest

commit e17a909f70
Merge: 33fcab5 25f9fd5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:31:51 2014 +0200

    Merge remote-tracking branch 'upstream/develop' into develop

commit 33fcab5727
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Oct 6 10:30:04 2014 +0200

    Bug fix, corrected gasLimit in vmSystemOperationsTest

commit 25f9fd542a
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:47:00 2014 -0400

    one more vm test

commit 2d561a5373
Author: Vitalik Buterin <v@buterin.com>
Date:   Sat Oct 4 15:15:37 2014 -0400

    separated out vmtests

commit b0c48fa8d6
Merge: cb8261a 6cae166
Author: vbuterin <v@buterin.com>
Date:   Sat Oct 4 17:18:02 2014 +0100

    Merge pull request #13 from CJentzsch/develop

    Added comprehensive EVM test suite. All commands are tested.

commit 6cae166f6f
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 15:34:23 2014 +0200

    Delete tmp.json

commit 4ff906fbc2
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Wed Oct 1 14:06:32 2014 +0200

    corrected CALLSTATELESS tests

commit 5b3fee6806
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 29 13:08:44 2014 +0200

    Completed vm tests. Added ADDMOD, MULMOD, POST, CALLSTATELESS

commit 9cdd218083
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 27 21:48:09 2014 +0200

    Added IOandFlowOperation-, PushDupSwap- and SystemOperations- tests. Removed empty storage from adresses.

commit 28ed968b46
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:49:22 2014 +0200

    Added blockInfoTest

commit ffbd5a35b5
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Tue Sep 23 15:37:52 2014 +0200

    Added environmentalInfo- and sha3- test

commit 54c14f1ff3
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Mon Sep 22 13:06:57 2014 +0200

    Added bitwise logic operation test

commit d0af113aab
Author: Christoph Jentzsch <jentzsch.software@gmail.com>
Date:   Sat Sep 20 01:42:51 2014 +0200

    Added vm arithmetic test

commit cb8261a78b
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Sep 19 13:15:44 2014 +0200

    Update genesishashestest.json

commit 4513623da1
Author: Maran <maran.hidskes@gmail.com>
Date:   Tue Jul 22 12:24:46 2014 +0200

    Update keyaddrtest to be valid JSON

commit e8cb5c221d
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 21 23:30:33 2014 -0400

    Added next/prev trie test

commit 98823c04b3
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Jul 14 02:51:31 2014 -0400

    Replaced with deterministic test

commit 357eb21e4d
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun Jul 13 16:12:56 2014 -0400

    Added my own random and namecoin tests (pyethereum)

commit 00cd0cce8f
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jul 12 21:20:04 2014 +0200

    Output hex strings.

commit ddfa3af45d
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 11:28:35 2014 +0100

    Everything a string.

commit d659f469a9
Author: Gav Wood <i@gavwood.com>
Date:   Thu Jul 10 10:16:25 2014 +0100

    Code fixes.

commit 5e83ea8228
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 16:17:12 2014 +0200

    Prettier VM tests.

commit a09aae0efe
Author: Gav Wood <i@gavwood.com>
Date:   Sun Jul 6 15:46:01 2014 +0200

    Fix VM tests.

commit ec9a044a17
Merge: 4bb6461 5e0123f
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Fri Jul 4 15:56:52 2014 +0200

    Merge pull request #10 from romanman/patch-1

    Update vmtests.json

commit 5e0123fbe1
Author: romanman <roman.mandeleil@gmail.com>
Date:   Fri Jul 4 10:23:04 2014 +0100

    Update vmtests.json

commit 2b6da2f5f2
Author: romanman <roman.mandeleil@gmail.com>
Date:   Thu Jul 3 17:45:04 2014 +0100

    Update vmtests.json

    arith testcase updated

commit 4bb646117d
Merge: bba3898 a33b309
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:22 2014 +0200

    Merge branch 'develop' of github.com:/ethereum/tests into develop

commit bba38980bd
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jul 2 19:43:06 2014 +0200

    New tests.

commit a33b309d99
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:14:05 2014 -0400

    Testing submodules

commit 50318217ca
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:10:46 2014 -0400

    Testing submodules

commit 57fa655522
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jul 2 10:09:08 2014 -0400

    Testing submodules

commit ea0eb0a8c8
Author: Gav Wood <i@gavwood.com>
Date:   Tue Jul 1 15:19:34 2014 +0200

    Latest genesis block.

commit 25bb76b69c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 13:25:04 2014 +0200

    Reset

commit 74c6d8424e
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Mon Jun 30 12:10:06 2014 +0200

    Updated wrong test

commit 9ea3a60291
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Sat Jun 28 18:48:28 2014 +0200

    Fixed roots

commit 5fc3ac0e92
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:40:06 2014 +0200

    Simple hex test.

commit edd3a00c2a
Author: Gav Wood <i@gavwood.com>
Date:   Sat Jun 28 18:22:18 2014 +0200

    Additional test for jeff. Now use the 0x... notation.

commit 5021e0dd83
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 21:35:26 2014 +0200

    VM test framework updated.

commit c818d13202
Author: Gav Wood <i@gavwood.com>
Date:   Fri Jun 27 18:18:24 2014 +0200

    Removed arrays from Trie tests JSON as per conformance guide and changed
    vocabulary to match other tests.
    VM test updates.

commit 714770ffb3
Author: Gav Wood <i@gavwood.com>
Date:   Wed Jun 11 11:32:42 2014 +0100

    Added Gav's new address.

commit 9345bc13d4
Merge: a2257f3 78576dd
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:38 2014 +0200

    Merge branch 'master' of github.com:ethereum/tests into develop

commit a2257f3471
Author: Gav Wood <i@gavwood.com>
Date:   Fri May 30 17:50:18 2014 +0200

    VM tests.

commit 78576dd3d3
Author: Heiko Heiko <heiko@heiko.org>
Date:   Fri May 30 17:19:09 2014 +0200

    changes based on new account structure nonce, balance, storage, code

commit 125839e848
Merge: 42e14ec 356a329
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Thu May 22 09:58:45 2014 +0200

    Merge pull request #5 from bkirwi/master

    Fix invalid JSON (removed trailing comma) and add test names

commit 356a3296bc
Author: Ben Kirwin <ben@kirw.in>
Date:   Thu May 22 00:20:48 2014 -0400

    Add some arbitrary test names

    This should now conform to the format specified in the README.

commit 42e14ec54f
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 23:27:40 2014 +0800

    revert to correct data

commit 4300197a74
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:42:23 2014 +0800

    fix: wrong sha3 hash because of the wrong rlp hex

commit a0d01b1a0b
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Wed May 21 22:29:53 2014 +0800

    fix: wrong rlp hex

commit 6bc2fc7405
Merge: 66bc366 c31a93c
Author: Jeffrey Wilcke <obscuren@users.noreply.github.com>
Date:   Wed May 21 14:11:37 2014 +0200

    Merge pull request #4 from ethers/master

    fix file name that seems to have been a typo

commit c31a93c27a
Author: ethers <ethereum@outlook.com>
Date:   Tue May 20 15:42:39 2014 -0700

    fix file name that seems to have been a typo

commit 66bc3665c1
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:36:35 2014 +0200

    fix: represent integers as strings

commit ede5499da6
Author: Heiko Heiko <heiko@heiko.org>
Date:   Tue May 20 17:21:09 2014 +0200

    add: current initial alloc and genesis hashes

commit 5131429abb
Author: Ben Kirwin <ben@kirw.in>
Date:   Mon May 19 11:18:31 2014 -0400

    Delete a comma

    This should now be parseable as JSON.

commit f44a859331
Author: Chen Houwu <chenhouwu@gmail.com>
Date:   Sun May 18 15:04:42 2014 +0800

    add: case when value is long, ensure it's not get rlp encoded as node

commit e1ae4ad449
Author: Gav Wood <i@gavwood.com>
Date:   Mon May 12 14:40:47 2014 +0100

    PoC-5 VM tests.

commit 2b6c136dda
Author: Vitalik Buterin <v@buterin.com>
Date:   Sun May 11 21:42:41 2014 -0400

    Moved txt to json

commit cbccbf977c
Merge: edbb8d4 45a0974
Author: Vitalik Buterin <v@buterin.com>
Date:   Thu May 8 21:54:48 2014 -0400

    New commit

commit edbb8d407e
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue May 6 16:53:43 2014 -0400

    Removed unneeded test, added new tests

commit 45a0974f6f
Merge: 15dd8fd 5fd2a98
Author: Gav Wood <i@gavwood.com>
Date:   Sun Apr 27 12:53:47 2014 +0100

    Merge pull request #3 from autolycus/develop

    Fixed formatting and added test cases

commit 5fd2a98fcb
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 13:26:14 2014 -0700

    Added some new test cases for the rlp encoding.

commit 4ba150954e
Author: Carl Allendorph <callendorph@gmail.com>
Date:   Sat Apr 19 12:48:42 2014 -0700

    Converted spaces to tabs to be compliant with the coding standards defined in cpp-ethereum

commit 15dd8fd794
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 12:54:47 2014 +0000

    RLP tests and Trie updates.

commit 33f80fef21
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:39:35 2014 +0000

    Hex encode tests done.

commit e1f5e12abb
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 28 11:22:49 2014 +0000

    Fix RLP tests.

commit f87ce15ad2
Author: Gav Wood <i@gavwood.com>
Date:   Thu Feb 27 13:28:11 2014 +0000

    Fix empty string.

commit c006ed4ffd
Author: Gav Wood <i@gavwood.com>
Date:   Mon Feb 24 10:24:39 2014 +0000

    Tests fix.

commit 510ff56363
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:54:08 2014 +0000

    Updated the tests.

commit a0ec843832
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:49:24 2014 +0000

    Moved over to new format, but RLP tests still need updating.

commit 660cd26f31
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:35:51 2014 +0000

    More docs.

commit 6ad14c1a15
Author: Gav Wood <i@gavwood.com>
Date:   Fri Feb 21 18:33:39 2014 +0000

    Added VM test suite.
    Added TODO.
    Renamed old files.

commit f91ad7b385
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 11:26:58 2014 -0500

    update trie algorithm

commit 6da2954462
Merge: cc42246 131c610
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 8 08:15:38 2014 -0500

    merge

commit cc4224675f
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Jan 7 14:35:26 2014 -0500

    Updated trie test

commit 131c610da6
Merge: 121632b 7613302
Author: vbuterin <v@buterin.com>
Date:   Wed Jan 1 06:40:54 2014 -0800

    Merge pull request #1 from obscuren/master

    Update trietest.txt

commit 7613302b49
Author: obscuren <obscuren@users.noreply.github.com>
Date:   Wed Jan 1 15:25:21 2014 +0100

    Update trietest.txt

    New proposed explanatory format

commit 121632bedd
Author: Vitalik Buterin <v@buterin.com>
Date:   Wed Jan 1 08:26:18 2014 -0500

    Added obscure's tests

commit ef6c5506c3
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 19:04:48 2013 -0500

    Fixed tests a bit

commit 345e4bcfef
Merge: 2c81698 e4bbea4
Author: Vitalik Buterin <v@buterin.com>
Date:   Tue Dec 31 15:52:46 2013 -0500

    Merge branch 'master' of github.com:ethereum/tests

commit 2c81698f31
Author: Vitalik Buterin <v@buterin.com>
Date:   Mon Dec 30 21:09:40 2013 -0500

    Added first three tests

commit e4bbea400f
Author: vbuterin <v@buterin.com>
Date:   Mon Dec 30 18:09:03 2013 -0800

    Initial commit
2014-11-04 17:11:19 +01:00
b96a59eb28 Added tests for extra large values
Test “E” scientific notation formatting
2014-11-04 16:45:54 +01:00
64b6172089 added db 2014-11-04 16:43:02 +01:00
e7d9bcd36b Added Douglas and Einstein cases 2014-11-04 16:42:28 +01:00
123282e045 Update variable name to match unit name 2014-11-04 16:41:03 +01:00
e22e8b7fef Environment tests 2014-11-04 16:39:08 +01:00
a9db1ee8d4 Replaced to return the td and throw a specific error on TD 2014-11-04 13:00:47 +01:00
699dcaf65c Reworked chain handling process
* Forks
* Rename
* Moved inserting of blocks & processing
* Added chain testing method for validating pieces of a **a** chain.
2014-11-04 12:46:33 +01:00
f4b717cb9d Bloom validation 2014-11-04 11:04:02 +01:00
f59a3b67f6 StateManager => BlockManager 2014-11-04 10:57:02 +01:00
1025d097fd removed old bloom 2014-11-04 10:49:25 +01:00
d56d0c64aa Version bump 2014-11-04 01:50:16 +01:00
0c4adeceae Properly list caps 2014-11-04 01:47:02 +01:00
f76f953f0c Removed debug print 2014-11-04 01:33:31 +01:00
9c2b878678 Sha addresses 2014-11-04 01:29:49 +01:00
a82b89e2d5 Added storage root to dump 2014-11-03 23:45:44 +01:00
c8302882c8 method change 2014-11-03 23:45:32 +01:00
d87aa24885 Fixed genesis 2014-11-03 23:45:16 +01:00
0cdef3376d example 2014-11-03 17:46:56 +01:00
92c7aca817 Refactored compress method into something more organised 2014-11-03 14:59:50 +01:00
b0e11826e5 lgpl 2014-11-03 12:40:57 +01:00
e3998e30ba Don't run 'npm test' 2014-11-02 22:00:13 -05:00
51d79f3e3b Fix JSHint errors 2014-11-02 21:56:45 -05:00
b773e57490 Enable Travis CI 2014-11-02 21:49:23 -05:00
76c9c8d653 Compress data on db level. Closes #174 2014-11-03 00:31:15 +01:00
bd4f51ff3c Use new iterator 2014-11-03 00:30:52 +01:00
5dcf59bdf4 Forgot to put in regular bytes during decompression 2014-11-03 00:29:34 +01:00
9f8bcf3abc Added RLE compression. Closes #171 2014-11-02 23:33:06 +01:00
1bb398f4e2 Sign ext 2014-11-02 19:39:45 +01:00
3f90f7c898 Signextend 2014-11-01 02:14:55 +01:00
c8438979a9 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-11-01 01:18:13 +01:00
141d3caabb Re-org op codes 2014-11-01 01:18:03 +01:00
394e0f60c2 chain, tests/helper, vm: make tests compile
They were broken by df5603de0a, when vm.Log became ethstate.Log.
2014-10-31 18:56:25 +01:00
b95d9e005d .gitignore: ignore .ethtest 2014-10-31 18:55:39 +01:00
f3473312ba all: fix rename breakage 2014-10-31 18:52:58 +01:00
5af4ff985d ethminer => miner 2014-10-31 14:56:42 +01:00
4914a78c8c ethwire => wire 2014-10-31 14:53:42 +01:00
af34749a6b ethtrie => trie 2014-10-31 14:45:03 +01:00
af8f5f0b69 ethstate => state 2014-10-31 14:43:14 +01:00
0ed1a8b50a ethpipe => xeth (eXtended ETHereum) 2014-10-31 14:30:08 +01:00
8826e9694c Moved utils to cmd 2014-10-31 14:20:11 +01:00
c8307a9e44 license 2014-10-31 14:12:05 +01:00
b1c247231b ethlog => logger 2014-10-31 12:56:05 +01:00
fd9da72536 ethcrypto => crypto 2014-10-31 12:37:43 +01:00
3ee0461cb5 Moved ethchain to chain 2014-10-31 10:59:17 +01:00
8e0a39f33f Updated to use ethereum.js 2014-10-31 10:50:16 +01:00
e84fa8d4e6 transacton => transaction 2014-10-30 23:36:06 +01:00
f11b5f3e40 Added account prop 2014-10-30 22:20:22 +01:00
5538ff7252 Fixed Qt provider
* postData => postMessage
* JSON.parse parsed wrong data on 'onmessage'
2014-10-30 22:17:50 +01:00
aca9a41fcf Merge pull request #1 from debris/master
Http JSON-RPC provider, http polling, little refactor, whisper
2014-10-30 21:35:40 +01:00
df5603de0a Moved logging to state, proper structured block
* Moved logs to state so it's subject to snapshotting
* Split up block header
* Removed logs from transactions and made them receipts only
2014-10-30 13:32:50 +01:00
fa890c8c01 Merge pull request #167 from fjl/feature/split-tx-event
Split TxEvent type for tx pre/post
2014-10-29 21:10:04 +01:00
ce2ec1980b Merge pull request #166 from fjl/fix/mist-quit
Fix Mist Shutdown
2014-10-29 21:09:32 +01:00
f05d422a97 ethchain: fix dependency 2014-10-29 20:39:26 +01:00
2ef044edfc Use new bloom when filtering for topics 2014-10-29 20:33:25 +01:00
cc67a84e94 Added bloom 9 point lookup and bloom test 2014-10-29 20:16:18 +01:00
81ec564ef6 Merge pull request #168 from fjl/feature/working-tests
Fix the tests
2014-10-29 19:48:38 +01:00
4cf69d7cd3 vm: fix basic VM tests
The tests now compile and won't panic for unexpected return values.

We need a recent-enough version of the mutan compiler because of
the new JUMPDEST requirements. Skip some tests if the installed mutan
version is too old. The debug VM test still fails, probably because
of an implementation bug.
2014-10-29 18:50:17 +01:00
38034c3066 ethwire: fix ClientIdentity test 2014-10-29 18:39:51 +01:00
56014844a9 ethpipe: delete useless test
It didn't compile and wouldn't have checked any results if it ever ran.
2014-10-29 18:38:52 +01:00
d9bccdde23 ethchain: fix tests
Adapted to recent BlockChain -> ChainManager rename.
2014-10-29 18:38:05 +01:00
051af604e2 ethcrypto: fix the tests
The Sha3 test contained the wrong expected result. Note that the
implementation hasn't changed, the test simply contained an outdated
expected value that was valid for the previous implementation.
2014-10-29 18:35:33 +01:00
cb607b4911 changes to make whisper working 2014-10-29 17:14:59 +01:00
31c6159019 filters refactored 2014-10-29 14:45:39 +01:00
9e2f071d26 Removed events from the state manager 2014-10-29 14:20:42 +01:00
9adb625846 polling whisper in progress 2014-10-29 12:44:50 +01:00
fb4113dab4 PoC 7 updates
* Bloom
* Block restructure
* Receipts
2014-10-29 10:34:40 +01:00
665a44646e Generic hashing method 2014-10-29 10:29:22 +01:00
6b3f5fb82b cmd/mist, ethchain, ethminer: split TxEvent (#165) 2014-10-29 03:50:20 +01:00
e252dbf989 eth: stop eventMux first
This fixes the hang in Ethereum.Stop.
2014-10-29 03:01:20 +01:00
8170f96ded javascript: remove unused quit channel
This fixes the hang in JSRE.Stop.
2014-10-29 03:00:29 +01:00
0b10cbd713 http renamed to httprpc 2014-10-28 16:53:31 +01:00
3119be908c db and shh 2014-10-28 13:42:55 +01:00
48125a25eb Added missing requires on SSTORE SLOAD 2014-10-28 13:26:30 +01:00
7849b7e978 Refund SSTORE properly 2014-10-28 13:22:04 +01:00
28d4250866 cleaner promises 2014-10-28 10:43:12 +01:00
5920aa7be6 Updated readme 2014-10-27 17:24:43 +01:00
1e55fe3aa2 Updated readme 2014-10-27 17:22:29 +01:00
9d386033ef Added bug 2014-10-27 17:16:03 +01:00
2b02d81253 Added in progress to readme 2014-10-27 17:14:37 +01:00
11b3f97520 Upped protocol 2014-10-27 17:02:45 +01:00
10782c5aae Added removal off erroneous txs. Fixed pipeline 2014-10-27 17:02:31 +01:00
cbc6709937 Version bump 2014-10-27 16:53:31 +01:00
ca18b3f1e9 Do not return error on VM exception 2014-10-27 16:53:20 +01:00
69e745c537 Return erroneous txs (so we can remove them from the pool) 2014-10-27 16:52:58 +01:00
003280888d increased default gas from 500 to 5000 2014-10-27 12:25:54 +01:00
797b93c98c Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-10-27 11:50:50 +01:00
b095bd3237 events should be set prior to calling mainloop 2014-10-27 11:50:38 +01:00
1d3f43f060 Added generic add balance method 2014-10-27 11:44:40 +01:00
d586dd902d Fixed bloom 2014-10-27 11:44:28 +01:00
272d58662c Implemented LOG. Closes #159 2014-10-27 11:44:16 +01:00
6623500c6b Implemented new bloom filter. Closes #156 2014-10-27 11:22:27 +01:00
08c26ab8b0 Removed unnecessary code. 2014-10-26 20:09:51 +01:00
f62b6742f2 Merge pull request #152 from ethersphere/p2p
initial commit of p2p package
2014-10-24 12:20:50 +01:00
e73aad959e ethutil: re-add build constraints in script*.go (fixes #151) 2014-10-24 01:04:10 +02:00
771fbcc02e initial commit of p2p package 2014-10-23 16:57:54 +01:00
119c5b40a7 Merge pull request #150 from fjl/develop
Merge eth-go repo into go-ethereum
2014-10-23 16:46:18 +02:00
184055b3e2 cmd/*: add license headers 2014-10-23 15:48:53 +02:00
bd2862aec6 fix 'go get' commands in after the move to cmd/ 2014-10-23 15:06:26 +02:00
69baa465ea Merge eth-go repository into go-ethereum
mist, etheruem have been moved to cmd/
2014-10-23 15:01:27 +02:00
66e439b6f4 http polling 2014-10-23 14:11:57 +02:00
feef194829 Chnged to use GetOp instead & added error + checking 2014-10-23 14:04:00 +02:00
91c876831a Update to HEAD tests 2014-10-23 13:25:10 +02:00
06aa74e7df All Stack requirements are now checked prior to reduring gas. 2014-10-23 10:14:55 +02:00
50fd469249 Merge branch 'master' into develop 2014-10-23 01:03:22 +02:00
7daa8c2f6e Merge pull request #148 from waffle-iron/master
waffle.io Badge
2014-10-23 01:03:05 +02:00
bb03276c19 Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop 2014-10-23 01:01:56 +02:00
411b9800ae Reflect VM Env changes 2014-10-23 01:01:41 +02:00
29b8a0bc5f Updated the VM & VM tests
* Stack Error shouldn't revert to previous state
* Updated VM Test tool
* Added Transfer method to VM Env
2014-10-23 01:01:26 +02:00
2e45e4d015 Print error using regular println. Fixes #146
We can't use our own logger because it hasn't been set up properly at
that point.
2014-10-23 00:59:35 +02:00
5662176f8c Merge pull request #149 from JosephGoulden/develop
Develop
2014-10-23 00:30:38 +02:00
1880c6b3dc Make tab capitisation consistent 2014-10-22 23:00:22 +01:00
6247a99f41 add waffle.io badge 2014-10-22 15:56:40 -06:00
53d5c490be Fix right-click context menu of block chain view. 2014-10-22 22:50:47 +01:00
51ecab6967 Do not set error on recover 2014-10-22 23:39:15 +02:00
f9ca054314 warning when provider is not set 2014-10-22 16:21:38 +02:00
f7c9c8928e messageHandler expects object instead of string 2014-10-22 16:12:41 +02:00
ea3048421f block, transaction, uncle by hash and number separately 2014-10-22 15:58:24 +02:00
037039cace Updated tests-subtree 2014-10-22 15:24:17 +02:00
b5beb1aac1 added a transfer method to vm env 2014-10-22 15:22:21 +02:00
5cd93a0618 http provider 2014-10-22 11:41:48 +02:00
ce05634f38 Debug only if a tx is set. Fixes #134 2014-10-22 11:11:12 +02:00
27cb0750c1 Procotol version bump for uncle list change 2014-10-21 13:43:30 +02:00
6b92d541da Empty string for uncle 2014-10-21 13:30:23 +02:00
6f08e30109 Reflect RPC changes 2014-10-21 13:25:54 +02:00
520fdfe346 PoC7 Net 2014-10-21 13:25:31 +02:00
10b252dd05 WIP RPC interface 2014-10-21 13:24:48 +02:00
eef4cd1b64 Updated properties 2014-10-21 00:49:33 +02:00
ac7994d8c7 Updated readme 2014-10-21 00:41:27 +02:00
8a7d1a69b3 Fixed setting providers to the right object 2014-10-21 00:37:58 +02:00
76b20be2ea Qt provider 2014-10-21 00:26:34 +02:00
74cab14b8d Moved WebSocketProvider 2014-10-21 00:15:10 +02:00
c8aa5feb14 Removed Key 2014-10-21 00:14:58 +02:00
590c393680 Updated according to the new Generic JSON RPC API 2014-10-21 00:14:41 +02:00
6ea44c466a Updated to reflect BlockChain changes 2014-10-20 12:03:31 +02:00
097ba56df5 Renamed block_chain to chain_manager 2014-10-20 11:53:11 +02:00
33ca8d7b8f moved 2014-10-18 23:31:10 +02:00
3ad1daa70d Added tests as subtree 2014-10-18 23:28:16 +02:00
3bc64b6b6e Readers 2014-10-18 23:20:25 +02:00
73c1c2c4af Travis bumped to 1.3 2014-10-18 14:20:51 +02:00
350b0b1f66 Re-enabled Travis 2014-10-18 13:50:48 +02:00
3ea0e904ad Reflect changed to eth/vm 2014-10-18 13:33:02 +02:00
20c742e474 Moved ethvm => vm 2014-10-18 13:31:20 +02:00
82a2e4fe28 Reflect changes to the eth/vm 2014-10-18 13:31:04 +02:00
6956b5104f fmt package was missing 2014-10-18 13:30:38 +02:00
a02dc4ccc3 Using proper naming scheme. Fixes #63 2014-10-18 13:23:01 +02:00
77badc8c46 Updated to reflect the Filter changes in eth-go 2014-10-18 13:20:35 +02:00
d2bb83833f Moved Filter's wrapping functions to their own util package. Fixes #61
* CLI ethereum should no longer require the Qt/QML package
2014-10-18 13:20:06 +02:00
e57989c0a6 Merge pull request #141 from thibauld/develop
Update documentation and install script to reflect renaming from ethereal to mist
2014-10-18 12:34:03 +02:00
b94dfc8d3a Update documentation and install.sh script to reflect renaming from ethereal to mist 2014-10-17 19:14:16 -04:00
70a00d602e Merge pull request #62 from fjl/fuck
tests/vm: fix syntax
2014-10-17 18:17:04 +02:00
df238dc7ec tests/vm: fix syntax 2014-10-17 17:39:31 +02:00
abdf5e76f3 Merge pull request #138 from erezwanderman/fixwindows
Fix ethereum compilation and functioning on Windows.
2014-10-17 17:26:04 +02:00
03fd832ee8 Merge pull request #139 from fjl/feature/simpler-log-system
Update for new ethlog.LogSystem interface
2014-10-17 17:24:51 +02:00
fc308b842e Merge pull request #59 from fjl/feature/raceless-ethlog
Improve package ethlog
2014-10-17 17:24:44 +02:00
35f339e942 ethlog: fix typo in documentation 2014-10-17 17:23:29 +02:00
fd9b03a431 ethlog: fix concurrency
Rather than spawning a new goroutine for each message,
run each log system in a dedicated goroutine.

Ensure that logging is still asynchronous by using a per-system buffer
(currently 500 messages). If it overflows all logging will hang,
but that's better than spawning indefinitely many goroutines.
2014-10-17 17:23:29 +02:00
c090a77f1c ethlog: simplify LogSystem interface
Messages are formatted by generic part, so the log system doesn't need
to provide formatting. This fixes the test from the previous commit.

As a small bonus, log systems now have access to the level of
the message. This could be used to provide colored logging in the
future.
2014-10-17 17:23:29 +02:00
50f5ba5b0c ethlog: add test for '%' in log message
This test fails because the log message is formatted twice.
2014-10-17 17:23:29 +02:00
cbd785cfe8 ethvm, tests/*: use log level constants 2014-10-17 17:23:28 +02:00
0165c18330 ethlog: use Godoc for code examples in documentation
This ensures that examples will actually compile.
2014-10-17 17:20:44 +02:00
e0f93c74c5 ethlog: add Godoc documentation, remove README 2014-10-17 17:20:44 +02:00
a6265cb49a ethlog: verify that Flush is blocking in TestLoggerFlush 2014-10-17 17:20:44 +02:00
793baf060a ethlog: don't buffer output in TestConcurrentAddSystem 2014-10-17 17:20:44 +02:00
ec132749aa ethlog: improve TestLogSystem
It's now safe for concurrent access.
Output checking looks better.
2014-10-17 17:20:44 +02:00
45d1052229 ethlog: fix StdLogSystem data race on level 2014-10-17 17:20:44 +02:00
d5a7ba1626 ethlog: add test that adds log systems concurrently 2014-10-17 17:20:44 +02:00
3b1296077b ethlog: Reset before each test 2014-10-17 17:20:43 +02:00
dac128a029 ethlog: fix test compilation error 2014-10-17 17:20:43 +02:00
4e95cecfb9 ethlog: improve dispatch concurrency
This also fixes a deadlock in the tests.
2014-10-17 17:20:43 +02:00
3976b52ed7 Updated vm 2014-10-17 17:14:29 +02:00
e183880d8b arith test 2014-10-17 17:11:45 +02:00
d7736a7bbb Quick dirty peer update 2014-10-17 17:11:34 +02:00
df2b70853f Merge pull request #58 from fjl/feature/event
Blocking event package
2014-10-17 17:10:34 +02:00
9e6411db31 Merge pull request #140 from fjl/feature/event
Adapt to new event package
2014-10-17 17:10:30 +02:00
3b70985284 added eth tester 2014-10-16 21:34:59 +02:00
fa84e50ddb event: panic for duplicate type 2014-10-16 18:59:28 +02:00
ade980912d ethreact: remove package 2014-10-16 18:51:21 +02:00
28570ef109 eventer: remove package 2014-10-16 18:51:21 +02:00
20cdb73862 ethchain: fix tests 2014-10-16 18:51:21 +02:00
36cdab2068 all: use (blocking) event package instead of ethreact 2014-10-16 18:50:48 +02:00
6906904896 event: make TypeMux zero value ready to use 2014-10-16 18:50:48 +02:00
10bbf265b2 event: make Unsubscribe idempotent 2014-10-16 18:50:48 +02:00
dac4a8f113 event: add some documentation 2014-10-16 18:50:48 +02:00
93fcabd251 Fixed most of the tests 2014-10-16 18:27:05 +02:00
f5b8775bed event: new package for event multiplexer 2014-10-16 18:14:35 +02:00
bb5038699e Corrected package .... 2014-10-16 13:41:44 +02:00
65cdb3436e Updated tests 2014-10-16 13:40:46 +02:00
86f789333a Moved state reset to defered function 2014-10-16 13:39:30 +02:00
febec5ca4a Switch EXT* codes 2014-10-16 13:39:11 +02:00
70f7a0be11 Use the state instead of the state object directly.
If a state gets reset and you still hold a pointer to the previous,
incorrect, state object you'll operate on the wrong object. Using the
state to set/get objects and attributes you won't have this problem
since the state will always have the correct object.
2014-10-16 13:38:21 +02:00
0a99719a39 mist: update for new ethlog.LogSystem interface (in ethereum/eth-go#59) 2014-10-16 12:07:43 +02:00
311c6f8a3f Fixed remote Arithmetic tests 2014-10-15 17:12:26 +02:00
7227552f42 Fix ethereum compilation and functioning on Windows.
repl console output is now colored.
repl "exit" command now works.
2014-10-15 02:41:26 +03:00
266d212094 Working on test suite 2014-10-15 00:41:00 +02:00
3d177be73e Couple of minor issues fixed
* CALLVALUE pushed incorrect value to the stack
* Set execution model to closure
2014-10-15 00:40:41 +02:00
0aea5fc4a3 adapt to new event package 2014-10-14 19:38:38 +02:00
7ca7938d8e Removed old installer script 2014-10-14 15:31:25 +02:00
f55e39cf1a Tests for native function calling 2014-10-14 13:37:26 +02:00
393a92811b Changed VM Test code 2014-10-14 12:21:46 +02:00
294b437414 New VM 2014-10-14 11:49:15 +02:00
c5bd32b0ad Refactored VM to two separate VMs; std & debug
Standard VM should be about 10x faster than the debug VM. Some error
checking has been removed, all of the log statements and therefor quite
some unnecessary if-statements.
2014-10-14 11:48:52 +02:00
03e082d4ac Merge branch 'master' into develop 2014-10-14 09:47:38 +02:00
db6f4ab1cc Merge branch 'master' into develop 2014-10-14 09:47:19 +02:00
1644b1e53e Merge pull request #137 from caktux/master
build status
2014-10-13 12:57:50 +02:00
cfd1f0907f build status 2014-10-12 02:15:15 -04:00
2e894b668a Max callstack 2014-10-11 00:41:37 +02:00
8128190fb2 Merge pull request #136 from fjl/feature/raceless-ethereum-filters
Fix chain filter data race
2014-10-10 22:59:11 +02:00
cb845b9bc8 Implemented AR PoW 2014-10-10 22:44:20 +02:00
56843ca0fc Added some methods to comply to the PoW block interface 2014-10-10 22:42:37 +02:00
e02c0fa808 Added generic big to 256 method. Implemented new iterator 2014-10-10 17:00:06 +02:00
9b494c6869 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-10-10 16:58:26 +02:00
3db6a8e92d Merge pull request #57 from fjl/feature/raceless-ethereum-filters
Fix filter map race
2014-10-10 16:57:54 +02:00
6fec5bd32e Merge pull request #56 from fjl/feature/raceless-eventer
Fix Eventer race
2014-10-10 16:57:50 +02:00
6877660fe2 Implemented new iterator 2014-10-10 16:56:28 +02:00
c1f8a640d3 mist: adapt to API changes in ethereum/eth-go#57 2014-10-08 19:16:03 +02:00
e83a999039 eth: fix filter map data race
This commit also documents (but doesn't enforce) that filters
are immutable while they're installed. This required a minor API
change.
2014-10-08 19:04:58 +02:00
44674cb96c eventer: fix data race 2014-10-08 16:31:08 +02:00
d451269977 eventer: add test for concurrent Post/Register
This test reports the race condition when run
using "go test -race".
2014-10-08 16:31:08 +02:00
7c9508ed71 eventer: fix tests 2014-10-08 16:31:08 +02:00
a38dafcc57 Moved the To256 2014-10-08 16:11:36 +02:00
bd7aca76e1 Proper new block 2014-10-08 12:33:33 +02:00
4de3ad1712 New block message 2014-10-08 12:29:49 +02:00
83a4b8b49b Version bump 2014-10-08 12:24:42 +02:00
b93d6ca5d2 Renamed Sha3Bin to Sha3 2014-10-08 12:06:48 +02:00
9d86a49a73 Renamed Sha3Bin to Sha3 2014-10-08 12:06:39 +02:00
f3196c915a Precompiled crypto contracts 2014-10-08 12:01:36 +02:00
9b60cf267a Removed POST & moved CALLCODE 2014-10-08 12:01:14 +02:00
11ace54307 ECRECOVER RIPEMD160 SHA256 2014-10-08 12:00:50 +02:00
6de726f16c Protocol bump 2014-10-08 12:00:03 +02:00
b417766b36 Minor tweaks for poc7 2014-10-08 11:59:44 +02:00
b4fa28a3e6 Merge branch 'release/0.6.8' into develop 2014-10-07 11:21:29 +02:00
d1a6084bf7 Merge branch 'release/0.6.8' 2014-10-07 11:20:52 +02:00
a9b857769d bump 2014-10-07 11:19:42 +02:00
0015ce1e35 kick of bad peers 2014-10-07 11:18:46 +02:00
4ed94d3d51 removed old windows & added websockets to mist 2014-10-07 11:18:34 +02:00
c95dfec5e4 push data instead of assign 2014-10-06 19:26:51 +02:00
e100aa3c6c Changed to new "created address" 2014-10-02 17:35:57 +02:00
677836cbee Kick off bad peers on bad chains and improved catch up on diverted chain 2014-10-02 17:35:38 +02:00
a75c92000f Black listing of bad peers 2014-10-02 17:03:48 +02:00
b55e017e62 Proper delete 2014-10-02 17:03:36 +02:00
82be305496 Fixed inconsistencies 2014-10-02 17:03:15 +02:00
3bc238b1ce Added eth providers
An ethereum provider provides an interface from which communication can
be done.
2014-10-02 10:56:22 +02:00
5053ec2190 Added download label 2014-10-02 01:37:23 +02:00
a34a971b50 improved blockchain downloading 2014-10-02 01:36:59 +02:00
5fa0173c41 msg 2014-10-02 00:03:19 +02:00
3af211dd65 Implemented WebSocket package 2014-09-30 23:26:52 +02:00
6db40ecb22 WebSocket interface
Web sockets handlers fully implemented. Filter handlers have yet to be
implemented.
2014-09-30 23:26:16 +02:00
a3c66b2740 How to spawn a websocket node 2014-09-30 22:58:09 +02:00
0cae9c3c1b Readme 2014-09-30 22:55:07 +02:00
68ccbefc94 init 2014-09-30 22:51:53 +02:00
ab6ede51d7 Working on new (blocking) event machine.
The new event machine will be used for loose coupling and handle the
communications between the services:

1) Block pool finds blocks which "links" with our current canonical
chain
2) Posts the blocks on to the event machine
3) State manager receives blocks & processes them
4) Broadcasts new post block event
2014-09-29 12:57:51 +02:00
ea0357bf02 Block pool is thread safe 2014-09-28 14:52:58 +02:00
44d50bc8d2 Have you seen my parents, sir? 2014-09-26 20:51:31 +02:00
e20b113053 Logging messages 2014-09-26 20:19:11 +02:00
0acdeca3d6 skip messages properly 2014-09-26 20:19:01 +02:00
a45e293267 Merge branch 'release/0.6.7' into develop 2014-09-26 13:48:04 +02:00
41ae6f298e Merge branch 'release/0.6.7' into develop 2014-09-26 13:47:47 +02:00
b8354124be Added protocol caps accessors 2014-09-26 13:45:26 +02:00
68119d0929 Fixed messages to use proper numbers 2014-09-26 13:32:54 +02:00
9ed8dc7384 Attempt to catch up from unknown block 2014-09-25 16:57:49 +02:00
2458697dad Merge branch 'master' into develop 2014-09-24 21:37:05 +02:00
206672db5e Merge pull request #52 from nicksavers/winfix
Add blank line after +build comment
2014-09-24 21:36:37 +02:00
5c2aa1d4f5 Merge branch 'master' into develop 2014-09-24 21:21:03 +02:00
5cb4120ef5 queue get peers each 10 seconds 2014-09-24 21:20:57 +02:00
496df5c29a Merge branch 'master' into develop 2014-09-24 21:13:35 +02:00
3aeba50c38 merge error 2014-09-24 21:13:28 +02:00
ecdda01841 Merge branch 'release/0.6.6' into develop 2014-09-24 20:41:03 +02:00
bb4495722f Merge branch 'release/0.6.6' 2014-09-24 20:40:54 +02:00
1118aaf840 Temp work around 2014-09-24 20:40:40 +02:00
544b7fba7f Merge branch 'tmp' into develop
Conflicts:
	peer.go
2014-09-24 19:59:14 +02:00
cba2f6c2c4 Block pool stop / start 2014-09-24 19:56:21 +02:00
1fe2d0d0e0 Peers no longer take care of block processing 2014-09-24 19:55:28 +02:00
54558dd8ae Removed log 2014-09-24 19:54:51 +02:00
60a8c9527c Mine without txs 2014-09-24 19:54:37 +02:00
84690bfbbe Changed the block fetching code and hash distribution 2014-09-24 19:54:30 +02:00
d3a0bb4f35 Info => Debug 2014-09-24 19:54:14 +02:00
ad13b402d7 Fixed race condition 2014-09-24 17:47:01 +02:00
b66fcf85df checkp 2014-09-24 11:55:02 +02:00
ba43364f36 tmp 2014-09-24 11:41:57 +02:00
57dc435f9b Added TD for each block 2014-09-24 11:39:17 +02:00
c582890590 Add blank line after +build comment 2014-09-23 20:04:06 +02:00
615d20598a Merge branch 'develop' 2014-09-23 18:19:56 +02:00
46a496428f ugh 2014-09-23 18:19:51 +02:00
bc1a173d2f Merge branch 'hotfix/0.6.5-3' into develop 2014-09-23 17:55:54 +02:00
5c5db7d931 Merge branch 'hotfix/0.6.5-3' 2014-09-23 17:55:45 +02:00
6800c3665a Re-added min gas price check on tx pool 2014-09-23 17:55:34 +02:00
b73c07dd80 Merge branch 'hotfix/0.6.5-2' into develop 2014-09-23 12:00:25 +02:00
ea67d853a8 Merge branch 'hotfix/0.6.5-2' 2014-09-23 12:00:10 +02:00
ac5e86b7ae Removed windows support for serpent :-( 2014-09-23 12:00:01 +02:00
1b66e1c93a Merge branch 'hotfix/0.6.5-1' into develop 2014-09-23 10:21:29 +02:00
0705bb3fe5 Merge branch 'hotfix/0.6.5-1' 2014-09-23 10:21:13 +02:00
48fd23dc10 don't mine without transactions 2014-09-23 10:20:55 +02:00
df30588eb6 Merge branch 'release/0.6.5' into develop 2014-09-22 19:34:49 +02:00
ce149d2733 Merge branch 'release/0.6.5' 2014-09-22 19:34:31 +02:00
7d08e4f7d1 Remove log 2014-09-22 18:15:32 +02:00
2ae3bda029 Increased from 200 nano to milliseconds 2014-09-22 18:15:10 +02:00
1bc815e0b1 Remove log 2014-09-22 16:30:30 +02:00
16871ae2b4 New Peer server 2014-09-22 16:28:49 +02:00
9ed5b4d90e Support C++ GetBlockHash by assuming empty = done 2014-09-22 16:28:28 +02:00
b65f29f8fa Added JavaScript JSON helper 2014-09-22 14:51:41 +02:00
65a802c678 Re-wrote Call and Execute to use the new vm messages 2014-09-22 14:51:21 +02:00
151f9c7f82 BigInt accept string 2014-09-22 14:50:53 +02:00
80261c803a Fixed deref ptr 2014-09-19 13:19:19 +02:00
863785a520 Updated opcodes 2014-09-18 16:48:42 +02:00
f3a93b046e Upped protocol version for VM change 2014-09-18 01:02:15 +02:00
b3834d8272 Removed extra slash so @nicksavers gets off my back ;-) 2014-09-17 16:28:30 +02:00
a26c479182 Added len 2014-09-17 15:58:02 +02:00
9559b53228 Added Past peers option 2014-09-17 15:57:44 +02:00
eb32fe20c8 Rewrite 2014-09-17 15:57:32 +02:00
fd041d91ee Truncate when writing 2014-09-17 15:57:07 +02:00
1549a29c9d Connect to previous peer 2014-09-16 16:36:27 +02:00
66e309c5c4 Up deadline to reduce cpu load 2014-09-16 16:36:18 +02:00
fb528c47c0 Moved code 2014-09-16 16:19:48 +02:00
74de0f1f2a Rewrote reading strategy 2014-09-16 16:06:38 +02:00
d02024929a require 5 for post 2014-09-16 11:35:26 +02:00
399256b384 VM execution fixes
Refactoring caused executing issues
2014-09-15 22:11:05 +02:00
33a0dec8a1 Improved catching up and refactored 2014-09-15 15:42:12 +02:00
2f614900e8 Updated GHOST 2014-09-15 01:11:01 +02:00
4db4ec1621 Added unique set 2014-09-15 01:10:50 +02:00
74ef22d824 add it to the list 2014-09-14 14:30:33 +02:00
86d1a26b13 fixed status message 2014-09-14 14:09:46 +02:00
742a9b00bc tmp 2014-09-14 13:47:29 +02:00
9e89dacc64 log removed 2014-09-14 13:42:13 +02:00
f63cb27803 tmp 2014-09-14 13:42:02 +02:00
954ba211bf Fixed contract validation address in tx pool 2014-09-14 12:02:35 +02:00
4b4830692a Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-09-14 00:13:32 +02:00
2fb57b2ea7 Reworked filters 2014-09-14 00:13:23 +02:00
96cf6fc147 Merge branch 'master' into develop 2014-09-13 14:39:10 +02:00
8ef17c2fb1 fi crypto 2014-09-13 14:39:01 +02:00
10564723b9 added string casting 2014-09-13 13:14:24 +02:00
369e8c4150 Merge pull request #49 from WeMeetAgain/develop
add pushtx to api
2014-09-11 13:28:05 +03:00
c0187930dc Removed some commented code 2014-09-10 11:39:11 +02:00
2f362509b8 New p2p protocol. NOTE: Needs major refactoring. See #50 2014-09-10 11:22:19 +02:00
8ac1b85a0b Merge branch 'feature-pushtx' into develop 2014-09-09 21:35:53 -07:00
7dacd7eb78 add pushtx to api
Previously the software assumed use of an internal private key for use in all broadcasted transactions. This addition lets nodes relay pre-signed transactions originating from sources other than the node itself.
2014-09-09 21:27:34 -07:00
2949990016 Added CALLSTATELESS 2014-09-10 00:19:20 +02:00
d91357d00c Added GetCode method 2014-09-08 00:50:04 +02:00
0fea62ec6d Make use of new list type for transactions instead of json 2014-09-08 00:49:47 +02:00
a63b74e345 New OPCODES
* EXT- CODECOPY, CODESIZE
2014-09-08 00:49:25 +02:00
0b6b6b52fe Contract creation address are empty again 2014-09-08 00:48:59 +02:00
250d40bca0 Reset the transient state when a new block's been found 2014-09-08 00:48:39 +02:00
adabd71a4a Changed back to FIPS 180 2014-09-07 22:34:24 +02:00
ff27df78fc Added new list type which can embed any slice type 2014-09-07 10:18:54 +02:00
627b7c9fd7 Updated to latest sha3 implementation. Fixes #48 2014-09-07 10:07:51 +02:00
6afc16399f Block size 2014-08-25 12:53:06 +02:00
3f904bf3ac Implemented POST 2014-08-25 11:29:42 +02:00
cdbc3ecc2a Serpent! :-) 2014-08-24 00:16:32 +02:00
67af300383 Merge branch 'master' into develop 2014-08-23 19:01:15 +02:00
ccea5fa948 changed to new nat-pmp repo 2014-08-23 19:01:06 +02:00
fcc6f183a4 Changed level 2014-08-23 19:00:52 +02:00
962255b373 Removed old code 2014-08-23 11:00:33 +02:00
d9d4f63cd4 Don't add ... 2014-08-22 17:57:33 +02:00
56103f0751 Log 2014-08-22 17:10:18 +02:00
be9bfb5536 Minor improvement catching up
* When catching up check linked up the chain of hashes
2014-08-22 14:52:20 +02:00
836ed9d6b7 Write Protocol version to the db so we can perform sanity checks 2014-08-22 11:34:59 +02:00
a9f9a59416 Extra checks 2014-08-22 10:58:57 +02:00
42d43147ca Changed log statements 2014-08-22 10:58:49 +02:00
93008e279d Removed old chain code 2014-08-22 10:58:14 +02:00
740081e2f7 Storage at changed to return bytes 2014-08-21 21:06:42 +02:00
088bbc6bb7 Merge branch 'release/0.6.4' into develop 2014-08-21 20:25:38 +02:00
2d00027fd9 Merge branch 'release/0.6.4' 2014-08-21 20:25:09 +02:00
d03ab3c976 invalidated SWAP/DUP 2014-08-21 20:25:02 +02:00
fb90ecc8bc Merge branch 'release/0.6.4' 2014-08-21 20:23:33 +02:00
5196f9a340 bump 2014-08-21 20:22:39 +02:00
732573ba51 Turbo mining 2014-08-21 20:13:26 +02:00
854d6d4e5c DUP/SWAP n & ADD/MULMOD 2014-08-21 19:23:54 +02:00
a289a77d5d DUP n SWAP n 2014-08-21 18:15:09 +02:00
3def9258be Turbo mode 2014-08-21 18:14:49 +02:00
0eb08693e9 Turbo mode 2014-08-21 18:14:41 +02:00
cc6ad034f1 Merge branch 'release/0.6.3' into develop 2014-08-21 15:46:51 +02:00
0af0f0d890 Merge branch 'release/0.6.3' 2014-08-21 15:46:26 +02:00
c173e9f4ab MIT -> LGPL 2014-08-21 15:43:14 +02:00
15ef3388c1 Doc 2014-08-21 15:27:01 +02:00
d90ae4d45b Prot 0.6.3 2014-08-21 15:24:19 +02:00
b368549fd5 Always return something valid 2014-08-21 15:12:13 +02:00
c44f4f32fe Re-enabled catching up flag 2014-08-21 14:52:21 +02:00
eaa2e8900d PoC 6 networking code.
* Added block pool for gathering blocks from the network (chunks)
* Re wrote syncing
2014-08-21 14:47:58 +02:00
79c64f6bca Added block by hash or number 2014-08-20 16:40:19 +02:00
89c442cadb Added block by number 2014-08-20 13:36:54 +02:00
55a2f35a64 JS Filter 2014-08-20 13:05:26 +02:00
b97ea0e447 Added JSFilter type 2014-08-20 09:59:09 +02:00
b0ae61c652 Removed the "Get" part 2014-08-18 10:17:45 +02:00
793e666f36 Dump bytes instead of strings 2014-08-17 12:42:32 +02:00
4008ff32c9 Mutan compile 2014-08-17 12:42:02 +02:00
d79387c27e Mutan compile 2014-08-17 12:41:52 +02:00
4bd6003b7f removed pub completely in favour of pipe 2014-08-16 01:38:02 +02:00
7d95e8624a Added message to closure && added change addresses 2014-08-15 16:19:10 +02:00
2b9f71c6ca Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-08-15 13:05:20 +02:00
d701b23230 Reworking the public js interface (pub) => (pipe) 2014-08-15 13:05:13 +02:00
79bc628858 Merge pull request #43 from ethersphere/develop
inline mnemonic wordlist to support binary builds without extra asset
2014-08-15 10:49:43 +02:00
ace551030f Convert to hex 2014-08-15 01:08:23 +02:00
c7ee9844bd Removed old code 2014-08-15 00:25:16 +02:00
0fcc606569 Added new filter from map 2014-08-15 00:24:37 +02:00
07cfb7b64a updated filter so it accepts multiple from and to 2014-08-14 17:02:39 +02:00
0d733aa071 Removed validation check from GetMessages 2014-08-14 17:02:21 +02:00
0283498140 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-08-14 12:11:59 +02:00
fa881220ae Updated lookup method to include CNAME's as well as A records 2014-08-13 10:52:50 +02:00
e85f3972b9 inline mnemonic wordlist to support binary builds without extra asset 2014-08-12 14:56:10 +02:00
a760ce05b9 Updated chain for filtering 2014-08-11 16:23:38 +02:00
2e5d28c73f Added bloom filter & block filter methods 2014-08-11 16:23:17 +02:00
42d2bc28af Upped protocol version 2014-08-09 18:10:11 +01:00
024be32f06 Make sure all left padded zero's aren't included 2014-08-09 18:09:55 +01:00
27290e1277 Fixed gas limit calculation 2014-08-09 18:06:16 +01:00
c51db4c940 Fixed stack issue 2014-08-08 14:36:59 +01:00
3fc24013ef Fixed issue with overflowing 256 bit integers 2014-08-08 12:04:18 +01:00
d6b0ab3028 Changed to DnsReg 2014-08-07 15:26:07 +02:00
7272577fe6 Added dns lookup 2014-08-07 15:11:54 +02:00
da50c75148 Added state dump method 2014-08-06 09:53:00 +02:00
4edf7cfb05 config => Config 2014-08-05 11:31:39 +02:00
3c78e418fb world => World 2014-08-05 11:30:12 +02:00
e71b198e3d Renamed object to Object 2014-08-05 11:26:12 +02:00
4f0bda403e Added vm options for object execution 2014-08-05 11:10:24 +02:00
c215bbadf1 pipe 2014-08-05 10:17:26 +02:00
0f84b9c30d Added exist method 2014-08-04 16:34:55 +02:00
342cc122b4 Added general Pipe API 2014-08-04 16:25:53 +02:00
03ce15df4c ethstate.NewState => ethstate.New 2014-08-04 10:42:40 +02:00
3debeb7236 ethtrie.NewTrie => ethtrie.New 2014-08-04 10:38:18 +02:00
2e7cf83522 Merge branch 'ethersphere-feature/ethutil-refactor' into develop 2014-08-01 10:30:19 +02:00
8bed47a2d4 Merge branch 'feature/ethutil-refactor' of https://github.com/ethersphere/eth-go into ethersphere-feature/ethutil-refactor 2014-08-01 10:22:25 +02:00
5ede1224e4 minor rlp things 2014-08-01 10:21:43 +02:00
9831619881 merge upstream 2014-07-30 18:03:20 +02:00
5a2d62e4d9 Added better data parser 2014-07-30 13:06:59 +02:00
42d47ecfb0 Removed peer disconnect on pong timeout. Fixes #106
This mechanism wasn't very accurate so it has been removed.
2014-07-30 11:26:38 +02:00
1f9894c084 Old code removed and renamed amount to balance 2014-07-30 00:31:15 +02:00
27f8922653 Increased block request amount 2014-07-29 23:34:21 +02:00
74d7012025 Added temp seed 2014-07-29 23:33:59 +02:00
5ca2938117 Fixed 2014-07-29 23:33:33 +02:00
6fd2401cdf Fixed issue with var int reading.
Reading uneven byte slices were broken.
2014-07-29 23:33:18 +02:00
6e94c024e4 Added big data test and updating to reader 2014-07-29 23:31:33 +02:00
d1d2b660dc Prot 2014-07-29 15:55:08 +02:00
8e7c4f91e3 Added ops 2014-07-29 10:33:30 +02:00
41bd38147c Clean up and util methods 2014-07-26 11:24:44 +02:00
92ffc1cc4c Merge branch 'release/0.6.0' into develop 2014-07-25 10:43:59 +02:00
d761af84c8 Merge branch 'release/0.6.0' 2014-07-25 10:43:35 +02:00
54f9ea14e1 Removed old S(DIV/MOD) 2014-07-25 09:57:47 +02:00
7ee49c32b7 Added update method and general service timer
* disable catching up if no block received for longer than 10 seconds
2014-07-24 17:10:54 +02:00
702cf5a3e1 Merge branch 'feature/refactor_vm' into develop 2014-07-24 14:16:04 +02:00
dcf4fad971 Networking code 2014-07-24 12:30:04 +02:00
6d69ca36a7 Peer reconnect attempt 2014-07-24 12:25:41 +02:00
a45c08f9fe Removed old code 2014-07-24 12:19:55 +02:00
3c3292d505 Added recoverable option 2014-07-24 12:12:00 +02:00
306b5bcff3 Changed catching up code & peer handler
* Peers should be added no matter what
* Catch up with _anyone_
2014-07-24 12:11:30 +02:00
cbd71ef8f5 Add Tx 2014-07-24 12:10:18 +02:00
32d125131f Refactored to new state and vm 2014-07-24 12:04:15 +02:00
958b482ada div 0 err 2014-07-23 12:36:47 +02:00
92b16618ed Merge branch 'master' into develop 2014-07-23 12:04:45 +02:00
a3771e7d7b Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-23 12:04:41 +02:00
06ec80f394 zero devision check 2014-07-23 12:04:27 +02:00
5d57b78471 Added big int to uint switch 2014-07-22 16:16:00 +02:00
490ca410c0 Minor improvements and fixes to the new vm structure 2014-07-22 15:57:54 +02:00
9c86e99968 Merge branch 'master' into develop 2014-07-22 12:16:09 +02:00
1e8b54abfb Refactored state, state object and vm
* The State and StateObject have been moved to their own package
* The VM is moved to it's own package
2014-07-22 11:54:48 +02:00
20ee1ae65e Refactored CALLDATALOAD to use big int
* Added BigMin
2014-07-21 20:38:43 +02:00
eab0b2a90a Merge branch 'master' into develop 2014-07-21 20:23:15 +02:00
194c58858c send zero event to miner.powQuitChan fixes miner hanging 2014-07-21 19:12:04 +01:00
67528cf970 ethreact/README.md 2014-07-21 15:10:56 +01:00
6774ddaba2 Fix regression on 32bit (windows) systems 2014-07-21 14:35:37 +02:00
13cc220c0d Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor 2014-07-21 13:31:26 +01:00
1e4af85a38 merge upstream 2014-07-21 13:26:29 +01:00
8f91d47bf3 Merge branch 'master' into develop 2014-07-21 12:21:42 +02:00
5d2669dbd3 Fixed tx sha creation 2014-07-21 12:21:34 +02:00
93261b98c2 Changed iterator 2014-07-21 11:56:04 +02:00
9f00aeae29 Base time on previous parent, not last block 2014-07-18 16:13:21 +02:00
2762ec22d0 Fixed miner and logger 2014-07-18 13:50:15 +02:00
cd9b344506 Fixed range 2014-07-18 13:21:40 +02:00
61cc2ba7d9 fixed 2014-07-18 13:00:22 +02:00
dad29bcaa1 Added channel for starting/stopping miner 2014-07-18 12:21:11 +02:00
65650a5c66 Merge branch 'develop' into guiminer 2014-07-18 12:03:19 +02:00
db8170def3 WIP to expose hashrate to gui 2014-07-18 12:01:08 +02:00
449b9a9d68 Check if version in known + fix 2014-07-18 11:57:44 +02:00
28a146d438 Added find name for namereg 2014-07-17 22:30:00 +02:00
6a19b62db6 added chainSync event 2014-07-17 22:01:13 +02:00
a626b7ebe1 Fixed string data 2014-07-17 17:11:00 +02:00
3331bb29ea bump 2014-07-17 15:35:46 +02:00
16f6100500 Removed debug log 2014-07-17 15:11:09 +02:00
90f63657cb Removed debug log 2014-07-17 15:01:33 +02:00
0415e4a637 Fixed coinbase copy in state 2014-07-17 14:53:27 +02:00
ed3424ff75 Trie fixes 2014-07-17 11:21:18 +02:00
14c4f06100 Convert a byte slice to address 2014-07-16 13:20:57 +02:00
8820d4e5ac Decreased timeout 2014-07-15 20:36:11 +02:00
7c0a27a0f4 Added each callback for storage 2014-07-15 20:36:04 +02:00
7a410643ac Added/changed logging 2014-07-15 20:35:55 +02:00
34da3b4fa8 Moved 2014-07-15 20:35:07 +02:00
4a2dd306c7 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-15 15:30:06 +02:00
09bade6466 Fixed an issue where the trie might crash on missmatching lengths 2014-07-15 15:29:54 +02:00
9a93169898 Rewrote mnemonic word loading to facilitate deployable builds. 2014-07-15 12:52:44 +02:00
017d36e6b2 properly unsubscribe react channels when miner stops - fixes write on closed chan crash 2014-07-15 01:29:07 +01:00
1735ec0362 use ethreact.Event and ethreact.ReactorEngine 2014-07-15 01:11:06 +01:00
0ecc5c815e reactor test 2014-07-15 00:15:37 +01:00
5ec62a5153 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-15 00:25:57 +02:00
2784e256f1 Vm logging on diff 2014-07-15 00:25:49 +02:00
50bc838047 Moved checks 2014-07-15 00:25:38 +02:00
69acda2c25 Paranoia check moved 2014-07-15 00:25:27 +02:00
98f21d8973 Compare method for receipts 2014-07-14 22:52:44 +02:00
767d24ea5d Removed defer and added receipts checking in tx processing 2014-07-14 22:52:30 +02:00
d1c89727dc fix send overwritten by merge 2014-07-14 19:02:34 +01:00
3d5db7288f merge upstream 2014-07-14 18:50:06 +01:00
dc11b5c55e fix reactor channel blocking 2014-07-14 18:40:18 +01:00
5c03adbded fix logger channel blocking 2014-07-14 18:37:01 +01:00
8845fb7eae Add windows helper functions 2014-07-14 15:24:38 +02:00
5a0c4ce295 Fixed "Copy" to also copy over the pending storage changes 2014-07-14 00:38:20 +02:00
04f8c455e2 Added diff type 2014-07-14 00:37:50 +02:00
2c46bfde8b Increased block request 2014-07-14 00:37:41 +02:00
5b2e5d180f Changed diff output not to prefix hex with 0x 2014-07-14 00:37:18 +02:00
6426f3635e Forgot to return gas when CALL's value transfer fails 2014-07-13 17:56:14 +02:00
ee3ba0b1d6 Catch up per 10 2014-07-13 17:45:39 +02:00
54715586ab Changed sha3 to official one 2014-07-12 11:10:47 +02:00
9010857677 Special diff output for execution 2014-07-11 16:04:09 +02:00
ff151f9fbc vm output 2014-07-10 21:54:36 +02:00
5c7e96d895 Removed serpent 2014-07-10 18:19:38 +02:00
04561c4ddc Updated VM & added helper methods to state
* VM BALANCE opcode updated to pop 1 item and use that to retrieve the
  address' balance
* GetBalance and GetNonce on state that'll always return something valid
2014-07-10 17:58:16 +02:00
9688ebef52 Return from execution immediately if there's no code 2014-07-10 15:31:48 +02:00
d6753b2883 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-10 15:06:55 +02:00
b7ff773ecf Removed debug log 2014-07-10 15:06:46 +02:00
e504088b79 Consensus and bug fixes
* Ensure that each state object has an address that is 20 bytes
* Byte logging for vm
* changed diff output
2014-07-10 15:05:06 +02:00
d52e5f7130 Removed hardcoded ip 2014-07-10 15:04:19 +02:00
bea468f1e5 Increased timeout to 500ms 2014-07-10 15:03:48 +02:00
639f1fd339 Log received and send to 2014-07-10 15:03:26 +02:00
67e5689f87 Fixed BYTE opcode 2014-07-10 12:51:19 +02:00
dcbd97d29c Check current folder for mnemonic words if it fails in source folder. For binary support 2014-07-09 10:59:49 +02:00
794e65b60e Updated peer server 2014-07-07 22:08:09 +02:00
6cb35836a2 Upped protocol version number 2014-07-07 16:06:09 +02:00
e4e704f480 Fix quit 2014-07-07 16:05:59 +02:00
14d13167a7 Remove debug println 2014-07-07 13:59:59 +02:00
78aad9a192 Getting rid of deprecated methods 2014-07-07 13:59:32 +02:00
b01cb2406f Fixed state reset case 2014-07-07 13:59:09 +02:00
42bb3d8aae Removed old if statement. No longer needed 2014-07-07 13:58:54 +02:00
96ac061e68 Log change 2014-07-07 13:58:28 +02:00
890745e846 Increased timeout 2014-07-07 13:58:20 +02:00
4d77b7face remove extra case in main loop 2014-07-07 12:30:25 +01:00
68fba4b781 Fixed state reset on err 2014-07-07 11:17:48 +02:00
239a5d3230 Merge pull request #34 from ethereum/revert-33-feature/ethutil-refactor
Revert "ethreact - Feature/ethutil refactor"
2014-07-07 10:59:26 +02:00
6fe9b4ab5e Revert "ethreact - Feature/ethutil refactor" 2014-07-07 10:59:16 +02:00
9dab7dcc3c Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-07 10:53:25 +02:00
d40cba3042 changed state reset 2014-07-07 10:53:20 +02:00
1199941475 Connect to peer node by default 2014-07-07 10:52:58 +02:00
ec040908e9 Protocol bump 2014-07-07 10:52:39 +02:00
b958179263 Merge pull request #33 from ethersphere/feature/ethutil-refactor
ethreact - Feature/ethutil refactor
2014-07-07 10:52:02 +02:00
5a2afc5754 fix reactor engine main loop blocked to wait if drained 2014-07-05 19:56:01 +01:00
d4300c406c logger fix
- introduce quit, drained, shutdown channels
- mainLoop falls through reading message channel to drained state, and waits is blocked in default branch until any message is sent
- Flush() waits for <-drained
- Stop() pushes quit and nodges mainloop out of blocking drained state
- package-global mutex
- Reset()
- clear tests
2014-07-05 19:11:08 +01:00
4fb2905b1e Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor 2014-07-05 12:53:00 +01:00
b232acd04e Debugging mode for vm 2014-07-05 13:24:49 +02:00
329887df99 Fixed crazy looping 2014-07-05 13:24:26 +02:00
44d0d6abd2 Merge branch 'develop' of github.com:ethereum/eth-go into feature/ethutil-refactor 2014-07-04 19:40:23 +01:00
0c6f1c9c3a ethreact
- consistent renaming
- React -> Event
- ReactorEvent -> EventHandler
- NewReactorEngine -> New
- async ReactorEngine main loop with select on main eventChannel and quit channel
- ReactorEngine main loop control with Start() Stop() Flush()
- ReactorEngine.dispatch
- use sync.RWMutex
- delete eventHandler if subscribed channels go to 0
2014-07-04 19:38:53 +01:00
584d1c61ec use ethreact.Event and ethreact.ReactorEngine 2014-07-04 19:38:44 +01:00
af27264140 remove reactor code from ethutil 2014-07-04 19:37:40 +01:00
90eb4f1939 Debug output, minor fixes and tweaks
* Script compile length fix
* Transition fix
2014-07-04 15:32:10 +02:00
23b5b5fa36 Length check 2014-07-04 13:34:50 +02:00
d5bcc01eae Fixed shebang check. Previously it would hang on an unknown shebang 2014-07-04 13:05:07 +02:00
633027d980 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-04 00:13:57 +02:00
d3d043dba0 Merge branch 'ethersphere-feature/clientid' into develop 2014-07-04 00:13:42 +02:00
db60ebbbd7 Merge branch 'feature/clientid' of https://github.com/ethersphere/eth-go into ethersphere-feature/clientid 2014-07-04 00:12:28 +02:00
cb7ebdf821 Decreased timeout 2014-07-04 00:12:21 +02:00
70e1a1a4df Merge pull request #32 from josephyzhou/develop
typo, duplications
2014-07-04 00:10:29 +02:00
7c41e413e4 typo, duplications 2014-07-03 11:31:47 -07:00
f02602d02d ConfigManager (transitional)
- remove clientstring handling from ethutil.Config
- ReadConfig takes no Identifier argument
- members Ver, ClientString, ClientIdentifier removed from Config
- type ConfValue removed
- expose public type ethutil.ConfigManager
- Set -> Save(key string, value interface{}) now takes any value to allow for persisting non-string values directly
- TODO: eliminate all eth specific configs, just a wrapper around globalconf
2014-07-03 17:30:51 +01:00
90c2064640 peer constructors now set version string with ethereum.ClientIdentity().String() 2014-07-03 17:30:37 +01:00
c833c3fec8 add ClientIdentity() ethwire.ClientIdentity to Ethereum 2014-07-03 17:30:04 +01:00
c64629964f ethwire.ClientIdentity now handles Client info sent in handshake + test 2014-07-03 17:28:27 +01:00
de2da4fd19 Merge branch 'develop' of github.com:ethereum/eth-go into feature/clientid 2014-07-03 15:08:13 +01:00
198e5eeab9 EthManager interface extended with ClientIdentity() ethwire.ClientIdentity 2014-07-03 15:08:06 +01:00
8baa0f84e7 Fixed reverting error 2014-07-03 16:07:21 +02:00
5d67139206 Fix 2014-07-03 10:05:02 +02:00
5b8dde9602 Fixed CREATE op. Fixes #87 2014-07-03 10:04:38 +02:00
81bc721c5c Fixed address generation 2014-07-03 10:03:58 +02:00
35ae9e3aa8 Paranoia check 2014-07-02 17:48:10 +02:00
2f9bc2ab75 Removed old code 2014-07-02 17:47:33 +02:00
8de099ae75 Added paranoia check 2014-07-02 17:47:18 +02:00
40e3d2ab55 Changed CREATE 2014-07-02 17:47:09 +02:00
6748158ab4 Moved methods 2014-07-02 13:40:02 +02:00
e4d2d00d41 Added support for breakpoints on specific instructions 2014-07-02 13:08:32 +02:00
315d65280b Removed comment 2014-07-02 11:30:14 +02:00
d15952c867 Moved debug hook to Vm directly 2014-07-02 01:04:21 +02:00
1954ef47e6 Suicide is deferred to update 2014-07-02 00:06:21 +02:00
fd1d0bbde7 Updated to generic padding function 2014-07-02 00:05:48 +02:00
d7e396a98c l <=> r 2014-07-01 23:59:37 +02:00
00d3935aac Removed old method 2014-07-01 23:59:18 +02:00
bb2433ca1a Added quitting reason 2014-07-01 20:32:47 +02:00
7238a77327 Removed old code 2014-07-01 20:12:18 +02:00
dd869064a6 delete? 2014-07-01 20:09:37 +02:00
7a2a63f32b Added utility wrapper for Ethereum Config contract
Note, this utility function has to move elsewhere
2014-07-01 20:09:21 +02:00
28ef7d228c Added Left and Right padding utility functions 2014-07-01 20:08:48 +02:00
6151ae7db5 Fixed key import for empty entries 2014-07-01 20:08:32 +02:00
3889785017 Added Path utility 2014-07-01 20:08:18 +02:00
7a9ff4f8d4 bump 2014-07-01 16:28:17 +02:00
29f613ef84 Merge pull request #28 from ethersphere/feature/keys
Feature/keys
2014-07-01 16:16:05 +02:00
ff5703fd9b ethutil -> ethtrie.NewTrie 2014-07-01 15:09:43 +01:00
89630d2826 merge upstream 2014-07-01 15:03:02 +01:00
550407b0ec Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-07-01 15:44:43 +02:00
d0959063d5 Up 2014-07-01 15:28:12 +02:00
d294dedfad Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-07-01 15:26:18 +02:00
e798294a4b Update min GasLimit 2014-07-01 15:25:57 +02:00
114e715e3c Merge branch 'ethersphere-feature/keys' into develop 2014-07-01 13:48:28 +02:00
253c23240b Merge branch 'feature/keys' of https://github.com/ethersphere/go-ethereum into ethersphere-feature/keys
Conflicts:
	.gitignore
	README.md
2014-07-01 13:45:39 +02:00
0ce9003ba7 Fix for creating a tx from an unknown account 2014-07-01 12:16:14 +02:00
2bbc204328 Close pow chat. Fixes #95 2014-07-01 11:55:50 +02:00
92693e4459 The dragon has been slain. Consensus reached! 2014-07-01 11:26:45 +02:00
39263b674c Paranoia 2014-07-01 09:56:10 +02:00
5f5910c603 Regression test for trie 2014-07-01 09:55:20 +02:00
ed276cd7c2 Added Paranoia check for VM execution 2014-06-30 20:03:31 +02:00
82272ee08a Iterator fix 2014-06-30 14:28:54 +02:00
9ed0d389b2 Generic trie 2014-06-30 13:34:47 +02:00
00bb68d7d2 Merge branch 'develop' into interop 2014-06-30 13:13:55 +02:00
c23074d5ad Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-30 13:13:45 +02:00
8ddd4c4c52 wip 2014-06-30 13:09:04 +02:00
5a86892ecb Using remote for test cases 2014-06-30 13:08:00 +02:00
12972b4b65 DBKeyStore.Load returns no error if keyring not found in db 2014-06-29 20:53:26 +01:00
2920795168 using keyPair.Mnemonic() in file key store Save method 2014-06-29 20:28:54 +01:00
25314313f8 added Mnemonic() and AsStrings() methods, added memoization for address 2014-06-29 20:28:04 +01:00
a8be0d9f48 add InitFromString method to be used in gui 2014-06-29 20:26:55 +01:00
dabaa4cce0 change all modified calls to ethtrie, ethutil and ethcrypto functions 2014-06-29 18:30:05 +01:00
707d413761 refactor ethutil/trie to ethtrie 2014-06-29 16:26:58 +01:00
4be3521727 import math/big 2014-06-29 16:17:33 +01:00
e3b911652d move CreateAddress from ethutil/common to ethcrypto 2014-06-29 16:08:33 +01:00
5e50b50dc3 no strconv import needed 2014-06-29 16:06:54 +01:00
772e7e8c8d Key Manager
- keypair, keyring:
-- consistent naming of methods
-- error propagation
-- no panic
- keyManager: persist, import, export, initialize and (re)set keyring
- no global public "singleton" keyring, instead interface via keyManager
- keys test
- KeyStore interface, DB and File store implementations
2014-06-29 16:02:23 +01:00
e1ea41ee9c remove ethutil helpers (refactored), and keypair (key management under ethcrypto package) 2014-06-29 16:01:57 +01:00
d87857ffdb config Pubkey removed (unused) 2014-06-29 15:59:57 +01:00
1db3e2241e move ethutil/mnemonic to ethcrypto - electrum word list now sourced from file 2014-06-29 15:59:35 +01:00
d085133c6d move ethutil helper crypto functions to ethcrypto/crypto 2014-06-29 15:57:12 +01:00
5c1e0a6dc4 move ethutil hex conversion functions to bytes 2014-06-29 15:56:40 +01:00
7489fb784e move ethutil helper slice functions -> slice 2014-06-29 15:56:19 +01:00
2eae52ebd1 Merge pull request #27 from ethersphere/bugfix/ethchain-test
transitional ethutil.ReadConfig fixes in ethchain tests (they still fail...
2014-06-28 10:22:23 +02:00
79009ca074 transitional ethutil.ReadConfig fixes in ethchain tests (they still fail! FIXME :) 2014-06-27 15:56:45 +01:00
8151858e70 Merge branch 'master' of github.com-obscure:ethereum/eth-go 2014-06-27 00:17:15 +02:00
6c7e58643c Merge branch 'develop' 2014-06-27 00:17:04 +02:00
423beddf57 nil check 2014-06-27 00:16:49 +02:00
30f5642c62 Merge pull request #26 from ethersphere/master
bump v5.15
2014-06-27 00:11:55 +02:00
e3ad2a3969 Merge branch 'develop' 2014-06-27 00:08:29 +02:00
8119d77a21 :-( 2014-06-27 00:08:19 +02:00
d551a75c35 bump v5.15 2014-06-26 21:20:02 +01:00
8935a93cf8 Merge branch 'release/0.5.15' into develop 2014-06-26 19:55:19 +02:00
9d5a3f0131 Merge branch 'release/0.5.15' 2014-06-26 19:55:14 +02:00
a98e6a262a Merge branch 'develop' into release/0.5.15 2014-06-26 19:53:08 +02:00
491925b71e Merge branch 'ethersphere-feature/logging' into develop 2014-06-26 19:52:31 +02:00
853053a3b2 go fmt 2014-06-26 18:45:57 +01:00
21e389bec5 bump 2014-06-26 19:04:57 +02:00
da38faa8f7 merge upstream; fix port in use warning; new logger API 2014-06-26 16:37:56 +01:00
098136b681 ethereum logs server started/stopped message 2014-06-26 10:43:02 +01:00
0ed19d9f20 Logging, variable rearrangement 2014-06-26 11:26:42 +02:00
39cb34850a Added instruction numbers 2014-06-26 11:25:43 +02:00
782f780476 space in miner logging message 2014-06-25 18:43:35 +01:00
a243e3b858 new logger API for upstream merge 2014-06-25 17:59:35 +01:00
98f1ee9442 merge upstream 2014-06-25 16:58:07 +01:00
a02edf7a93 put back extra debug detail logging to the right places using logger.DebugDetailf 2014-06-25 16:40:06 +01:00
6465e4c3fd update doc: list levels and show usage of named print methods 2014-06-25 16:38:42 +01:00
e75f7ae330 implement DebugDetail loglevel and named print methods 2014-06-25 16:37:38 +01:00
b0dc50c2a0 New mutan implementation 2014-06-25 17:26:34 +02:00
6d32bef65a Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-25 17:22:30 +02:00
4141cc39d0 Merge remote-tracking branch 'upstream/develop' into feature/logging 2014-06-25 16:13:27 +01:00
d8c675afbf Implement something that looks like confirmations, wip 2014-06-25 16:23:10 +02:00
8fe8175c78 Implemented TX History for ethPub 2014-06-25 16:12:33 +02:00
589d27386a Fix key generation in ethPub 2014-06-25 14:05:55 +02:00
e58ba2fcfa Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-25 09:47:27 +02:00
9dae1a1732 Removed BlockDo Method 2014-06-25 09:47:19 +02:00
0c55a11318 Support hex and decimal keys for GetStorageAt RPC. Fixes ethereum/go-ethereum#74 2014-06-24 11:15:26 +02:00
16e8fc7427 Logging order 2014-06-23 16:11:55 +02:00
f58c7ac5a6 merge upstream 2014-06-23 13:07:43 +01:00
63157c798d refactor config (transitional). Details:
- ReadConfig initialiser sets up global ethutil.Config via config file passed from wrappers
- does not write out adhoc default (not meant to) but creates empty config file if it does not exist so that globalconf does not complain if persists a flag
- default datadir and default config file set together with other flag defaults in wrappers
- default assetpath set together with other command line flags defaults in gui wrapper (not in ethutil.Config or ui/ui_lib)
- add EnvPrefix, to handle environment variable options too via globalconf
- this is still transitional: global Config should just be a wrapper around globalconfig config handler and should be moved to go-ethereum
- actual eth stack config should not be global instead config handled properly with explicit dependency injectioninto eth stack component instances
2014-06-23 12:55:38 +01:00
b9e8a3e024 modified logging API
- package vars for tagged loggers
- weed out spurious fmt.PrintX and log.PrintX logging
- tried to second guess loglevel for some :)
2014-06-23 12:54:10 +01:00
8e9cc36979 refactor logging. Details:
- packages use tagged logger sending log messages to shared (process-wide) logging engine
- log writers (interface ethlog.LogSystem) can be added to the logging engine by wrappers/guis/clients
- shared logging engine dispatching to multiple log systems
- log level can be set separately per log system
- async logging thread: logging IO does not block main thread
- log messages are synchronously stringified to avoid incorrectly logging of changed states
- README.md
- loggers_test
2014-06-23 12:49:04 +01:00
614624754d Let the state create the object 2014-06-23 13:42:30 +02:00
d890258af6 Minor fixes to vm output 2014-06-23 11:26:51 +02:00
803e4807ed Removed comments 2014-06-23 11:26:31 +02:00
a4e26bf7c2 Added Block do which replays the given block or error 2014-06-23 11:25:14 +02:00
9350ecd36f Do not keep on asking for the same chain 2014-06-23 11:24:45 +02:00
8c96c5662f Added hex script method 2014-06-23 11:24:07 +02:00
842d52db7b Make sure that public key always uses 64 bytes 2014-06-23 11:23:51 +02:00
bb1641e4ec Clean up & refactored methods 2014-06-23 11:23:18 +02:00
299b50a0d4 Support serpent lang 2014-06-21 02:40:25 +02:00
931ae0f116 Append zero's in R & S 2014-06-20 20:12:08 +02:00
7fb5e993e3 Moved 0 check to state object for now 2014-06-20 20:11:40 +02:00
0251fae5cc Changed loggers 2014-06-20 01:10:39 +02:00
0c6b41f4c9 CALLDATACOPY 2014-06-20 01:10:20 +02:00
f63f3853bb Merge branch 'release/0.5.14' into develop 2014-06-20 00:47:59 +02:00
3f1f8438ed Merge branch 'release/0.5.14' 2014-06-20 00:47:52 +02:00
7ad073fb30 bump 2014-06-20 00:47:50 +02:00
09f37bd023 Returned to single method 2014-06-20 00:45:44 +02:00
8f29f6a4d4 Removed some logging 2014-06-20 00:42:26 +02:00
6fcc6a2f7c Changed copy/set 2014-06-20 00:41:42 +02:00
0b8ba1d55b Renamed snapshot to copy/set and added it back to the VM 2014-06-20 00:41:28 +02:00
933aa63b7d Length check on get 2014-06-19 21:41:37 +02:00
80ffe1610c Removed log 2014-06-19 13:45:46 +02:00
9104dcc29c Fixed call 2014-06-19 13:45:29 +02:00
7e6684d926 Method for checking contract addresses 2014-06-19 13:42:47 +02:00
1b431f29e5 Added missing types 2014-06-19 13:42:28 +02:00
5ea7598408 Update after each transition instead of at the end.
Updating the state /after/ the entire transition creates invalid
receipts.
2014-06-19 13:42:14 +02:00
731f55a05d Reset state when a transition fails 2014-06-19 13:41:17 +02:00
509389be97 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-06-18 13:48:52 +02:00
f911087eab Logging 2014-06-18 13:48:42 +02:00
c4af1340fa Updated test 2014-06-18 13:48:29 +02:00
3bc57fe5b5 CALLDATALOAD return 32 byte at all times 2014-06-18 13:48:08 +02:00
7f94bd09ae Return a single byte if byte get called 2014-06-18 13:47:40 +02:00
d179f31d4f Merge branch 'feature/peers' into develop 2014-06-18 13:19:12 +02:00
fba6de834e Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-06-18 13:19:03 +02:00
1f79175898 Reworked peers to check for public key duplication and adding peers to peerlist only after the handshake has come in 2014-06-18 13:06:48 +02:00
2fbcfd8824 Proper checks for multiple data items. Fixes #80 2014-06-18 11:55:05 +02:00
22e16f15a6 Reduce peer timeout to 10 seconds 2014-06-18 10:39:42 +02:00
dc9c9369e0 log 2014-06-18 00:36:23 +02:00
2565a79575 Swapped vars 2014-06-18 00:32:48 +02:00
8a885c2606 Fixed GT and LT 2014-06-18 00:25:58 +02:00
ca79360fd7 Verbose logging for VM 2014-06-17 18:49:26 +02:00
34c8045d5b Fixed issue where JUMPI would do an equally check with 1 instead of GT 2014-06-17 18:05:46 +02:00
a90ffe1af1 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-06-17 11:40:37 +02:00
01e6f63e98 A handful of GUI fixes 2014-06-17 11:40:23 +02:00
3621988e15 Removed deprecated states 2014-06-17 11:07:37 +02:00
53e30f750d Removal of manual updating of state objects
* You'll only ever need to update the state by calling Update. Update
  will take care of the updating of it's child state objects.
2014-06-17 11:06:06 +02:00
6656f99c54 Merge branch 'release/0.5.13' into develop 2014-06-16 18:25:33 +02:00
5a0e751736 Merge branch 'release/0.5.13' 2014-06-16 18:25:24 +02:00
ff0f15f763 bump 2014-06-16 18:25:21 +02:00
887debb055 comment 2014-06-16 18:20:38 +02:00
0d77632839 Refund gas 2014-06-16 12:25:18 +02:00
8b15732c1e Check for nil receiver 2014-06-16 12:04:56 +02:00
48bca30e61 Fixed minor issue with the gas pool 2014-06-16 11:51:16 +02:00
9f62d441a7 Moved gas limit err check to buy gas 2014-06-16 11:14:01 +02:00
b836267401 .. 2014-06-16 11:13:37 +02:00
7b55bcf484 Removed old fees 2014-06-16 11:13:19 +02:00
15d1f753f7 Removed old fees 2014-06-16 11:13:06 +02:00
1d76e433f7 Removed some comments 2014-06-16 10:40:21 +02:00
02d8ad030f Keeping old code for reference 2014-06-16 10:35:35 +02:00
58a0e8e3e2 Changed RlpEncodable 2014-06-16 00:52:10 +02:00
dccef70728 Method for creating a new key from scratch 2014-06-16 00:51:55 +02:00
1fbea2e438 Reworking messaging interface 2014-06-16 00:51:21 +02:00
8198fd7913 Cache whole objects instead of states only 2014-06-16 00:51:04 +02:00
d80f999a21 Run contracts 2014-06-15 00:11:06 +02:00
5871dbaf5a Set contract addr for new transactions 2014-06-15 00:10:42 +02:00
b0e023e432 Increase ping timeout to 30 seconds 2014-06-15 00:04:18 +02:00
6d52da58d9 Logging mechanism 2014-06-14 15:44:13 +02:00
63883bf27d Moving closer to interop 2014-06-14 11:46:09 +02:00
8124547348 Moving a head closer to interop 2014-06-13 16:06:27 +02:00
c734dde982 comments & refactor 2014-06-13 13:06:27 +02:00
cebf4e3697 Refactored state transitioning to its own model 2014-06-13 12:58:01 +02:00
5e2bf12a31 Refactored state transitioning to its own model 2014-06-13 12:57:52 +02:00
d078e9b8c9 Refactoring state transitioning 2014-06-13 12:45:11 +02:00
b855e5f7df Changed opcode numbers and added missing opcodes 2014-06-12 11:19:32 +02:00
6593c69424 Merge branch 'develop' into interop 2014-06-12 10:07:40 +02:00
3a9d7d318a log changes 2014-06-12 10:07:27 +02:00
8a2e50ab2a Merge branch 'develop' into interop
Conflicts:
	peer.go
2014-06-11 21:56:59 +02:00
9ee6295c75 Minor changes 2014-06-11 21:55:45 +02:00
1bf6f8b4a6 Added a buy gas method 2014-06-11 21:55:34 +02:00
4d3209ad1d Moved process transaction to state manager
* Buy gas of the coinbase address
2014-06-11 21:55:23 +02:00
9ff97a98a7 Namereg lookup fix 2014-06-11 21:51:21 +02:00
1938bfcddf Fix compare 2014-06-11 16:16:57 +02:00
71ab5d52b6 Exposed usedGas through ethPub 2014-06-11 11:40:50 +02:00
e090d131c3 Implemented counting of usedGas 2014-06-11 11:40:40 +02:00
97cc762143 Expose GasLimit to ethPub 2014-06-11 10:28:18 +02:00
bdc206885a Don't mine transactions if they would go over the GasLimit implements ethereum/go-ethereum#77 further. 2014-06-10 17:23:32 +02:00
69044fe577 Refactor to use new method 2014-06-10 17:22:43 +02:00
753f749423 Implement CalcGasPrice for ethereum/go-ethereum#77 2014-06-10 17:22:06 +02:00
2e6cf42011 Fix BigMax to return the biggest number, not the smallest 2014-06-10 17:15:18 +02:00
2995d6c281 Validate minimum gasPrice and reject if not met 2014-06-10 15:02:41 +02:00
1b40f69ce5 Prevent peer stop crash by removing logging 2014-06-10 14:59:38 +02:00
771f64397f Stop peers when they don't respond to ping/pong. Might fix ethereum/go-ethereum#78 2014-06-10 13:51:34 +02:00
d8339fa29a Merge branch 'release/poc5-rc12' into develop 2014-06-09 22:24:13 +02:00
006ac772e6 Merge branch 'release/poc5-rc12' 2014-06-09 22:24:05 +02:00
a51dfe89c0 bump 2014-06-09 22:23:30 +02:00
c7d1924c34 sha 2014-06-09 21:35:56 +02:00
1153fd9a0c Added Douglas and Einstan 2014-06-06 12:12:27 +02:00
a56f78af67 Implement getStateKeyVal for JS bindings.
Gives JS the option to 'loop' over contract key/val storage
2014-06-04 15:54:39 +02:00
d7b882977c Make contract creation error more explicit by mentioning the sneder 2014-06-03 11:56:19 +02:00
2010fea088 Added faux latency for peeroverview 2014-06-03 10:42:55 +02:00
fb6ff61730 Implemented Public Peer interface 2014-06-02 15:20:27 +02:00
ff8a834ccc Merge branch 'develop' 2014-05-30 19:51:25 +02:00
9e8127accb woops 2014-05-30 19:51:19 +02:00
6b7dfa1fb5 Merge branch 'develop' 2014-05-30 16:58:31 +02:00
17c825f53a Peer changes broadcasting and minor miner fix 2014-05-30 16:57:58 +02:00
b15e03acd7 Fixed issue with casting to smaller byte array 2014-05-30 16:57:40 +02:00
e0b6a31613 Buffered channel to fix not ready (blocking) 2014-05-30 13:27:56 +02:00
f382221b28 Broadcast "peerList" event upon removing or adding peers 2014-05-30 13:04:08 +02:00
6c91ffcfbe Do not panic, but return nil instead 2014-05-30 11:48:37 +02:00
15e0093e13 Fixed issue where the client could crash when sending malformed data 2014-05-30 11:48:23 +02:00
99797858a6 Added coin base to pub block 2014-05-30 11:47:23 +02:00
8fcba0eb1e fixed test 2014-05-29 23:54:48 +02:00
9bb7633254 Removed fmt 2014-05-29 11:50:36 +02:00
e7097641e3 Support for namereg 2014-05-29 11:49:41 +02:00
a2d01d6af8 Removed comments 2014-05-29 02:05:57 +02:00
2ef3a98929 Merge branch 'develop' 2014-05-28 23:23:40 +02:00
4d98762486 Fixed state object gas return 2014-05-28 23:16:54 +02:00
73a42d34a5 Merge branch 'release/poc5-rc11' into develop 2014-05-28 16:19:42 +02:00
95adac7522 Merge branch 'release/poc5-rc11' 2014-05-28 16:19:31 +02:00
76a59274bf Bump to RC11 2014-05-28 16:19:25 +02:00
a453b5514d Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-28 15:54:56 +02:00
8601604a09 Hooked up the Block Explorer to the Debugger so we can instantly debug made transactions 2014-05-28 15:48:23 +02:00
b695c82520 Fixes #60 2014-05-28 15:07:11 +02:00
a98e35d7a0 Length checking 2014-05-28 13:55:32 +02:00
65722aeeca Added StringToBytesFunc 2014-05-28 13:14:56 +02:00
8278ba5e45 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-28 12:39:41 +02:00
6e98e5709a Set initial used gas 2014-05-28 12:39:34 +02:00
2fec1af275 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-28 12:15:46 +02:00
cfb979b5e3 Add contract addr if it's a contract creation tx 2014-05-28 12:15:43 +02:00
9988b1a047 Sort transactions based on the nonce
* Added a transaction sorter
2014-05-28 12:06:09 +02:00
73761f7af6 Closure call now returns the total usage as well
* Return the used gas value based on the UseGas and ReturnGas
2014-05-28 12:05:46 +02:00
1c01e9c095 10 2014-05-28 12:03:40 +02:00
98d4b51120 Changed opcode names 2014-05-28 12:03:12 +02:00
ab8c7252da Merge branch 'release/poc5-rc10' into develop 2014-05-27 16:11:25 +02:00
818cbcbdd4 Merge branch 'release/poc5-rc10' 2014-05-27 16:11:19 +02:00
a428533160 bump 2014-05-27 16:10:18 +02:00
006c757a03 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-27 13:32:37 +02:00
4eb1771e67 Hooks can now quit the vm 2014-05-27 13:32:31 +02:00
aba3066658 Changed debug hook and added state iterator 2014-05-27 13:10:18 +02:00
c1b09d639c Disamble tx data before adding it to PTx object 2014-05-27 10:38:31 +02:00
817def000b Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-27 10:29:47 +02:00
6e24d603a1 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-27 01:08:59 +02:00
5cdfee5143 New Trie iterator 2014-05-27 01:08:51 +02:00
2232974cda Changed var names around 2014-05-26 17:18:51 +02:00
aefcb83419 Updated Public Block and Transaction objects with more information 2014-05-26 17:07:04 +02:00
24a6d87c3f Don't handshake if there is no key yet; first start on Ethereal 2014-05-26 11:47:47 +02:00
4c7bd75c1a Merge branch 'release/poc5-rc9' into develop 2014-05-26 00:42:18 +02:00
b1463b2dc2 Merge branch 'release/poc5-rc9' 2014-05-26 00:42:07 +02:00
1f3f76cb09 bump 2014-05-26 00:38:53 +02:00
3ebd7f1166 State snapshotting 2014-05-26 00:09:38 +02:00
81ef40010f The body of contracts are now returned instead 2014-05-25 14:13:54 +01:00
99fa9afaf1 Updated to work with the new config 2014-05-25 14:13:07 +01:00
281559d427 Canonical contract creation 2014-05-22 18:24:04 +02:00
cc8464ce80 Transaction querying 2014-05-22 17:56:33 +02:00
230aafbf66 Working on interop
* Receipts after each transaction
* Fee structure
* Applying fees to miners
2014-05-22 17:35:26 +02:00
14787ac148 Fixed some issues connecting for interop 2014-05-22 17:33:46 +02:00
4e1c6a8a22 Added start / stopping methods 2014-05-22 00:25:34 +02:00
f8f84ef095 Removed old contract creation code 2014-05-22 00:25:02 +02:00
e1b7bd51ee Return a disassembled script instead of the hex 2014-05-21 15:54:44 +02:00
56c2f651fe Merge branch 'develop' 2014-05-21 14:06:03 +02:00
c371f9a162 Merge branch 'release/poc5-rc8' into develop 2014-05-21 14:05:48 +02:00
d6e398aba4 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-21 14:05:30 +02:00
7fe73deb2d Merge branch 'release/poc5-rc8' 2014-05-21 14:04:25 +02:00
8f5eddd0ba Bumped 2014-05-21 14:04:19 +02:00
f5852b47d1 Removed some logging and refactored a bit 2014-05-21 14:00:13 +02:00
1275e5bdc9 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-21 13:06:42 +02:00
86cf69648e Improved miner so it won't include invalid transactions 2014-05-21 13:04:40 +02:00
d658a7f4ab Implemented missing EthPub calls in RPC server 2014-05-21 12:46:24 +02:00
0e9c8568fd Re broadcast transactions 2014-05-21 12:39:15 +02:00
2667cb3ab6 Apply to parent 2014-05-21 12:39:07 +02:00
0c27c5eb7f Proper log statement 2014-05-21 12:38:56 +02:00
05e4e97276 Fixed Public block creation. Added block logging 2014-05-21 12:09:28 +02:00
07fe00c466 Changed numbers 2014-05-21 11:42:31 +02:00
cbf221f6b7 Fixed competing block method 2014-05-21 11:42:20 +02:00
734b2e4cf7 Merge branch 'hotfix/4' into develop 2014-05-21 01:12:39 +02:00
85793a4706 Merge branch 'hotfix/4' 2014-05-21 01:12:33 +02:00
3c35ba7c31 Fixed state overwriting issue 2014-05-21 01:12:28 +02:00
5ceb1620e9 Fixed couple issues
* (imp) Lock / RLock tries
* (fix) stack
2014-05-21 00:17:50 +02:00
e8b4585295 Merge branch 'master' into develop 2014-05-20 22:45:10 +02:00
6ef2832083 Upped prot 2014-05-20 22:45:01 +02:00
6ba534af92 Merge branch 'hotfix/3' into develop 2014-05-20 22:44:10 +02:00
47fd4833ee Merge branch 'hotfix/3' 2014-05-20 22:44:05 +02:00
64701e388c Fixed state issue 2014-05-20 22:43:59 +02:00
27aae60381 Merge branch 'hotfix/2' into develop 2014-05-20 22:05:04 +02:00
7dae955c1a Merge branch 'hotfix/2' 2014-05-20 22:04:58 +02:00
3b38df085e Fixed casting issue 2014-05-20 22:04:47 +02:00
de87e436ab Merge branch 'hotfix/1' into develop 2014-05-20 19:20:09 +02:00
e837c9ab3f Merge branch 'hotfix/1' 2014-05-20 19:20:04 +02:00
ad51c85e5d Fixed crash 2014-05-20 19:19:53 +02:00
9562aba86a Merge branch 'release/poc5-rc7' into develop 2014-05-20 17:09:53 +02:00
4b13f93a3e Merge branch 'release/poc5-rc7' 2014-05-20 17:09:44 +02:00
c37b3cef7d Bump 2014-05-20 17:08:53 +02:00
0c4040d191 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-20 15:02:53 +02:00
2bd377a3de Changed transaction hash for poc 5 2014-05-20 15:02:46 +02:00
31e44c2ab9 Change shorthands 2014-05-20 14:53:34 +02:00
f5d4414734 Fix notification when processing block that didn't have this client as origin 2014-05-20 14:41:35 +02:00
7d3e99a2ab Fixed genesis and block data 2014-05-20 14:29:52 +02:00
b4e156e1d7 Up protocol version 2014-05-20 13:29:46 +02:00
6a31d55b2e added roman 2014-05-20 13:29:21 +02:00
45b810450f ... 2014-05-20 13:09:44 +02:00
f292e93e0e Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
Conflicts:
	ethchain/transaction.go
2014-05-20 13:07:08 +02:00
378815ee62 Rearranged according to YP 2014-05-20 13:06:47 +02:00
38b4dc2cdf Merge pull request #21 from nicksavers/patch-1
Rearrange transaction RLP encoding...
2014-05-20 13:06:27 +02:00
530ab6b8fc Re-arranged transaction RLP encoding...
According to latest Yellow Paper specs and conform other clients
4794642e51
2014-05-20 13:02:37 +02:00
fafdd21e4f unused 2014-05-20 12:23:49 +02:00
faa57ecaef Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-20 12:19:25 +02:00
2450398862 Added Maran to premine 2014-05-20 12:19:21 +02:00
36c9c93720 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-20 11:50:43 +02:00
12f30e6220 Refactored a lot of the chain catchup/reorg. 2014-05-20 11:50:34 +02:00
fd19142c0d No longer store script directly in the state tree 2014-05-20 11:19:07 +02:00
a2fb265563 Added a fatal method 2014-05-19 17:02:16 +02:00
b8034f4d9e Increment nonce in the public api 2014-05-19 12:14:04 +02:00
bd48690f63 Testing different mining state 2014-05-19 11:25:27 +02:00
8730dfdcc2 Changed how changes are being applied to states 2014-05-17 14:07:52 +02:00
88686cbed2 listen to pre instead of post 2014-05-15 15:00:25 +02:00
f95993e326 M 2014-05-15 14:54:07 +02:00
7bf2ae0b11 Removed old tx pool notification system. Fixes #19 2014-05-15 14:05:15 +02:00
2734fc4079 Merge branch 'release/poc5-rc6' into develop 2014-05-14 21:34:49 +02:00
6efdd21633 Merge branch 'release/poc5-rc6' 2014-05-14 21:34:30 +02:00
ad4ffdc947 Bumped version 2014-05-14 21:34:13 +02:00
65f570271c Fixed catching up 2014-05-14 20:50:37 +02:00
a6b9ea05e8 Test 2014-05-14 20:36:21 +02:00
166853aed9 Test 2014-05-14 20:35:23 +02:00
98a631b556 Remove any invalid transactions after block processing 2014-05-14 16:29:34 +02:00
ff2cf2dacd Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-14 13:57:08 +02:00
3ac74b1e78 Implemented IsUpToDate to mark the node as ready to start mining 2014-05-14 13:57:04 +02:00
f4fa0d48cb Moved keyring to ethutil & removed old methods. Implements #20 2014-05-14 13:54:40 +02:00
0512113bdd Removed defer 2014-05-14 11:56:06 +02:00
7c0df348f8 Increased deadline 2014-05-14 11:52:16 +02:00
0c1f732c64 Do not queue messages if the peer isn't connected (e.g. timing out) 2014-05-14 11:29:57 +02:00
283f4d8eb3 Merge branch 'develop' 2014-05-13 17:59:10 +02:00
a4883a029f Propagate back to network 2014-05-13 17:51:33 +02:00
b2181ac814 Merge branch 'develop' 2014-05-13 16:38:56 +02:00
b0798e0a72 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-13 16:38:47 +02:00
9831ba20b2 Merge branch 'release/poc5-rc4' into develop 2014-05-13 16:38:38 +02:00
485e04d9df Merge branch 'release/poc5-rc4' 2014-05-13 16:38:26 +02:00
86d6aba012 Bumped 2014-05-13 16:36:43 +02:00
c9ac5b0f74 Removed lingering log statement 2014-05-13 14:44:12 +02:00
28357d657b Implemented new JS/EthPub methods
- getTxCountAt
- getPeerCount
- getIsMining
- getIsListening
- getCoinbase
2014-05-13 14:43:29 +02:00
8ec1bb382a Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-13 12:42:35 +02:00
cac9562c05 Use EthManager interface instead 2014-05-13 12:42:24 +02:00
d31303a592 Implemented support for a custom RPC port 2014-05-13 12:01:34 +02:00
a9d5656a46 Added support to NewJsonRpc to return an error as well as an interface
Also changed default port to 8080. Fixes #18
2014-05-13 11:49:55 +02:00
3647cc5b07 Implemented our own makeshift go seed. Fixes #16 2014-05-13 11:35:21 +02:00
cc341b8734 Added debug message if you try to add a peer when max peers has been reached. 2014-05-12 16:36:14 +02:00
52b664b0ae Removed peers from peerlist as soon as they disconnect. Might fix #13
We used to wait for the reaping timer to clean up the peerlist, not any longer
2014-05-12 16:32:21 +02:00
8fe0864680 Only accept peers if we asked for them 2014-05-12 16:09:23 +02:00
5fcbaefd0b Don't forward localhost connections over the public network 2014-05-12 15:43:10 +02:00
7f9fd08792 Implemented proper peer checking when adding new peers
We now resolve a hostname to IP before we try to compare it to the existing peer pool
2014-05-12 15:08:21 +02:00
8b4ed8c505 Properly exchange peer capabilities between peers 2014-05-12 13:39:37 +02:00
4eb3ad192e Made the debug line for invalid peer versions dynamic 2014-05-12 12:28:56 +02:00
36572f03a7 Merge branch 'release/poc5-rc3' into develop 2014-05-10 16:24:21 +02:00
a32dffb0e8 Merge branch 'release/poc5-rc3' 2014-05-10 16:24:14 +02:00
e22e83b19a bump 2014-05-10 16:23:50 +02:00
d3d9ed62e2 Upgraded to new mutan 2014-05-10 16:23:07 +02:00
be7da48dad Merge branch 'release/poc5-rc2' into develop 2014-05-10 02:04:14 +02:00
3af35d922e Merge branch 'release/poc5-rc2' 2014-05-10 02:04:06 +02:00
dbf8645aaf Bump 2014-05-10 02:02:54 +02:00
c03bf14e02 Fixed some tests 2014-05-10 02:01:09 +02:00
afe83af219 Moved seeding and moved manifest 2014-05-09 16:09:28 +02:00
5a0bae1dae Auto update state changes notifications 2014-05-08 19:09:36 +02:00
e8fb965ccb Cleaned up
Removed the unneeded address watch mechanism. State manager's transient
state should now take care of this.
2014-05-08 18:41:45 +02:00
d709815106 Added trans state and removed watch address etc
The transient state can be used to test out changes before committing
them to the proc state. The transient state is currently being used by
the gui to support proper nonce updating without having to wait for a
block. This used to be done by a cached state mechanism which can now
safely by removed.
2014-05-08 18:26:46 +02:00
f0440e85dc Removed value from closure. 2014-05-08 14:20:45 +02:00
554f4f6f7d Fixed disasamble for all pushes 2014-05-08 14:20:06 +02:00
6c66cb3fa9 Merge branch 'develop' of github.com:ethereum/eth-go into develop 2014-05-07 11:05:53 +02:00
45ce820b11 Implemented value() 2014-05-07 11:05:49 +02:00
76d7bad722 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-05-06 17:43:34 +02:00
a0af7de58e Optimizations 2014-05-06 17:43:27 +02:00
050684450b Assume arguments are supplied as strings to the rpc interface 2014-05-06 17:04:52 +02:00
e18b96b486 Fix an issue where we don't have the rpc so we dont have to close it 2014-05-06 14:15:02 +02:00
af6875f4b2 Changed to lower case 2014-05-05 17:14:29 +02:00
66af749023 Merge branch 'release/poc5-rc1' into develop 2014-05-05 15:55:55 +02:00
2096b3a9ed Merge branch 'release/poc5-rc1' 2014-05-05 15:55:43 +02:00
fedd4c906f bump 2014-05-05 15:55:26 +02:00
78cb04cca3 wrong string 2014-05-05 15:51:43 +02:00
14a6e6a9ce Added the ability to submit byte code for contracts instead of Mutan code. 2014-05-05 15:48:17 +02:00
3e5a7b34b1 Now with files 2014-05-05 15:15:43 +02:00
a4ca9927ab Renamed etherpc to ethrpc 2014-05-05 15:15:14 +02:00
9b1f11695d Get rid of that annoying number that keeps popping up in stdout 2014-05-05 14:20:20 +02:00
87a5e94525 Merge branch 'develop' into feature/rpc 2014-05-05 14:16:53 +02:00
b98cc2fb4e Fixed GetBlock when no block can be found 2014-05-05 14:15:58 +02:00
fde3e01f80 Fixed import cycle 2014-05-05 14:15:31 +02:00
c496aad20b Renamed Ethereum RPC package 2014-05-05 13:49:59 +02:00
8adad0654a Added more JSON niceties to types 2014-05-05 13:49:46 +02:00
5757f5df2a Added secret to address method 2014-05-05 13:09:29 +02:00
39b8c83ba6 Impelemented GetStorageAt 2014-05-05 13:01:02 +02:00
7c91159449 Added different storage notification object 2014-05-05 11:56:25 +02:00
4f20e8f649 Implemented first few methods via public api 2014-05-02 20:00:58 +02:00
1f6df0cd52 Added receipts for tx creation 2014-05-02 14:08:54 +02:00
69d83b1da5 Merge branch 'develop' into feature/rpc 2014-05-02 14:08:27 +02:00
e798f221dd Added public interface 2014-05-02 13:55:43 +02:00
c54788338a Merge branch 'develop' into feature/rpc 2014-05-02 13:35:54 +02:00
ebdf339a61 Implemented RPC framework 2014-05-02 13:35:25 +02:00
70c8656640 Added a KeyPairFromSec function which creates a new keypair based on the given seckey 2014-05-02 12:11:55 +02:00
17674fb888 Added suicide back in 2014-05-01 22:14:34 +02:00
91aa189ef3 Fixed Upnp bug 2014-05-01 22:14:20 +02:00
e6a68f0c3a Removed debug log 2014-05-01 22:13:59 +02:00
d2ab322267 Removed debugging log 2014-04-30 17:43:48 +02:00
c3293641e7 Removed debug logging 2014-04-30 17:13:32 +02:00
21724f7ef9 Added manifest changes and changed closures 2014-04-30 14:43:32 +02:00
38d6b67b5c Fixed state problem 2014-04-29 12:36:27 +02:00
5516efdfa0 Removed old code 2014-04-27 18:05:30 +02:00
21f8806eed Moved assembler stage to the mutan compiler 2014-04-27 18:01:37 +02:00
bf850974f3 Using mutan assembler stage 2014-04-27 18:00:38 +02:00
338b698091 Refactoring and added documentation comments 2014-04-27 17:16:53 +02:00
16e52327a4 Upped version number 2014-04-27 16:53:35 +02:00
05d2d8f27d Actually convert gas 2014-04-26 02:11:00 +02:00
ca6e3f6def Notify of changes 2014-04-26 02:06:25 +02:00
d3a159ad3d Fixed tests 2014-04-26 01:54:45 +02:00
0f93da400a Added new state object change echanism 2014-04-26 01:48:40 +02:00
f3818478e2 Removed debug & unused functions 2014-04-24 13:48:33 +02:00
ee7c16a8d9 Fixed Base problem and sload/sstore 2014-04-24 13:30:57 +02:00
1c85d8c66b Minor improvements and bug fixes
* Fixed VM base bug
2014-04-24 00:00:50 +02:00
0651af9dfd Removed some log statements and disabled additional validation checks 2014-04-23 15:54:15 +02:00
c81804444f Call initial closure with proper tx argument 2014-04-23 15:53:53 +02:00
ef7f3f36e2 Renamed CALLDATA to CALLDATALOAD 2014-04-23 15:53:34 +02:00
f7d4e3cd6b Copy over bytes from previous root
Copy over instead of directly using the previous root. This is order to
avoid resetting problems
2014-04-23 15:52:50 +02:00
6b08efabf8 @maranh see comment 2014-04-23 12:14:28 +02:00
3a9a252f6e Fixed minor issue with gas and added state object init 2014-04-23 11:51:04 +02:00
61cd1594b5 Fixed gas, price & value setters on initialization 2014-04-23 11:50:38 +02:00
11c26e3211 Implemented ethereum package reader 2014-04-23 11:50:17 +02:00
6930260962 Updated VM 2014-04-20 01:31:01 +02:00
a96c8c8af9 Added proper gas handling 2014-04-18 13:41:07 +02:00
c5729d7ecc comments 2014-04-16 04:07:52 +02:00
d811920d8b Hack for miner problem added w/ note
@maranh please check
2014-04-16 04:07:21 +02:00
9c6aca7893 Merged accounts and contracts in to StateObject
* Account removed
* Contract removed
* Address state changed to CachedStateObject
* Added StateObject
2014-04-16 04:06:51 +02:00
ca13e3b105 Moved assembler stage processing to it's own file 2014-04-15 16:16:38 -04:00
086acd122b Added pre processing of script data 2014-04-12 00:13:42 -04:00
116516158d Renamed 2014-04-11 13:29:57 -04:00
ca747f2688 Added the possibility for debug hooks during closure call 2014-04-11 08:28:30 -04:00
7d6ba88d2b Merge branch 'split' into develop 2014-04-10 21:05:58 -04:00
d927c154e7 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-04-10 21:05:23 -04:00
25dd46061f Added push20 2014-04-10 21:03:14 -04:00
afc92fb7d7 Added better address format 2014-04-10 18:32:54 -04:00
891f725909 Added better address format 2014-04-10 18:14:19 -04:00
969e748dce Call fixed 2014-04-10 15:30:14 -04:00
6a530ea371 Call fixed 2014-04-10 14:40:12 -04:00
0fccbeabcc No longer return a list, but raw bytes 2014-04-09 12:28:34 -04:00
720521ed4a Changed how txs define their data & added init field 2014-04-09 12:28:16 -04:00
e09f0a5f2c Split code for contracts 2014-04-09 12:27:54 -04:00
4f2e9c2640 Check for nil 2014-04-09 12:27:25 -04:00
5714a82778 Small tweaks to mnemonic 2014-04-09 11:06:30 -04:00
272b135b74 One more line of comment 2014-04-09 10:40:55 -04:00
335dc9e687 Merge branch 'develop' into feature/mnemonic 2014-04-09 10:06:51 -04:00
03e139d23b Switched variable names 2014-04-09 16:04:36 +02:00
6d28bf534f Added a length for copy 2014-04-09 16:00:28 +02:00
c0cad0b534 Merge branch 'miner' of github.com-obscure:ethereum/eth-go into miner 2014-04-09 15:50:49 +02:00
a83db489df Fix transaction on new blocks 2014-04-09 09:48:17 -04:00
035f0ffb8a Reverted changes 2014-04-09 15:08:10 +02:00
b66a99e32d Added todo 2014-04-09 08:55:39 -04:00
527a3bbc2a Typo fix 2014-04-09 14:53:20 +02:00
c0a030ef0a Added new insruction methods 2014-04-09 14:08:18 +02:00
35a82f8f4a Added support for mneomnic privkeys 2014-04-07 14:00:02 +02:00
12643c7c57 Merge branch 'develop' into miner 2014-04-05 11:25:29 +02:00
90bb512f42 Update 2014-04-05 10:49:07 +02:00
782910eaa7 Small tweaks 2014-04-01 15:54:29 +02:00
3558dd5ed4 Finalize blockchain reverting test 2014-04-01 14:42:48 +02:00
0a88010826 Merge conflicts 2014-04-01 14:20:55 +02:00
7d0348e4ba Handle contract messages 2014-04-01 10:41:30 +02:00
5f49a659c3 More blockchain testing 2014-03-31 12:54:37 +02:00
7277c42047 Fixed some state issues 2014-03-31 01:03:28 +02:00
7cc28c8b46 Added storage test 2014-03-30 22:03:08 +02:00
205e33bc83 Fixed bug in stack to expand beyond expectations. Fixed EQ and NOT opcode 2014-03-30 18:55:51 +02:00
6625b6ffbd Changed to new mutan API 2014-03-30 12:58:37 +02:00
b888652201 Added missing GetTx (0x16) wire message 2014-03-28 11:20:07 +01:00
60fd2f3521 Update vm_test.go
store ...
2014-03-27 23:25:03 +01:00
75e6406c1f Fixed tests 2014-03-27 23:17:23 +01:00
3c3431d111 Fixed IsContract method to use the contractCreation flag 2014-03-27 23:17:14 +01:00
56a58ad70d Removed debug and comments 2014-03-27 22:02:39 +01:00
00c5f9b9a6 Updated transaction model
Changed the behaviour of decoding rlp data. Something is considered to
be creating a contract if the 4th item is a list.

Changed constructors.
2014-03-27 19:49:47 +01:00
7660e1ed90 Added a IsList method for type checking []interface{} 2014-03-27 19:42:01 +01:00
43cad69016 Reworked transaction constructors 2014-03-27 15:42:39 +01:00
308c59320c Fixed typo 2014-03-27 15:38:55 +01:00
6253d10938 initial testcode for canonical chain 2014-03-24 15:04:29 +01:00
e0b6091d7e Test fixes and removed old code. Added VM gas fees 2014-03-24 13:20:34 +01:00
ec6ec62dd4 Remove some xtra logs 2014-03-24 10:56:52 +01:00
97786d03d5 Merge branch 'master' into miner 2014-03-24 10:24:39 +01:00
274d5cc91c FindCanonicalChain returns true or false when we are on the Canonical chain or not 2014-03-24 10:24:06 +01:00
6a86c517c4 Removed old VM code 2014-03-22 11:47:27 +01:00
01c1bce9c5 Removed regular ints from the virtual machine and closures 2014-03-21 18:22:47 +01:00
9a9e252cab Changes 'compiler' to work with any type 2014-03-21 15:27:18 +01:00
b52b1fca89 Initial block reorganisation code 2014-03-21 15:06:23 +01:00
2ea4c632d1 Closure return, arguments fixed. Added proper tests 2014-03-21 14:47:55 +01:00
fa1db8d2dc Implemented closure arguments 2014-03-21 11:54:36 +01:00
9cf8ce9ef8 New tx methods and added new vm to state manager 2014-03-21 00:04:31 +01:00
f567f89b99 Added address to account and contract
Contract and account now both have an address field or method for the
sake of simplicity.
2014-03-20 23:38:16 +01:00
7705b23f24 Removed caller from tx and added "callership" to account.
Transactions can no longer serve as callers. Accounts are now the
initial callee of closures. Transactions now serve as transport to call
closures.
2014-03-20 23:17:53 +01:00
f3d27bf5d8 Rewrote opcodes again 2014-03-20 22:51:20 +01:00
c68ff9886b Fixed MSTORE and added some more commets 2014-03-20 19:50:53 +01:00
f21eb88ad1 Some minor updates 2014-03-20 17:27:48 +01:00
c642094cac Added encoder interface 2014-03-20 17:27:26 +01:00
3520771d68 Comply to Callee interface 2014-03-20 17:27:09 +01:00
c17381b853 Moved code around 2014-03-20 17:26:51 +01:00
59d8dc3950 Fixed issue with stack where it sliced of the wrong values 2014-03-20 17:26:30 +01:00
38ea6a6d5d Closures and vm based on closures
Status: Work in progress
2014-03-20 17:26:07 +01:00
82d0f65dab Comply to Callee structure 2014-03-20 17:25:11 +01:00
c135b389fe Commented out code due to rewrite vm 2014-03-20 17:24:53 +01:00
bdc0d1b7ad Added AddFunds method 2014-03-20 17:24:02 +01:00
ae837c4719 More mining rework 2014-03-20 11:20:29 +01:00
344e827061 Added client string to configuration
Clients can set their own client string which will be send to connected
peers during the handshake.
2014-03-17 12:08:16 +01:00
2be2fc7974 Merge branch 'develop' into miner 2014-03-17 11:15:28 +01:00
826c827e6b Added a copy method to state 2014-03-17 11:15:09 +01:00
2b9b02812e Log 2014-03-17 11:14:00 +01:00
07578fe25f Pretty print nonce 2014-03-17 11:13:35 +01:00
095d5baaed Merge conflicts 2014-03-17 10:41:05 +01:00
8ea7e21f64 Merge 2014-03-17 10:37:37 +01:00
3274e0a249 Removed extra invalid nonce return 2014-03-17 10:37:29 +01:00
b15a4985e8 Moved on to the state manager 2014-03-17 10:33:03 +01:00
d5efeab8f9 Initial smart-miner stuff 2014-03-10 11:53:02 +01:00
54bcee512d Merge branch 'develop' of https://github.com/jarradh/eth-go into jarradh-develop 2014-03-07 11:26:46 +01:00
685ea3e9a9 Wip keychains 2014-03-07 11:26:35 +01:00
694ef47041 gofmt -w ethereum.go 2014-03-07 11:11:11 +01:00
9d887234ea Small Optimization on port 2014-03-06 19:11:38 +01:00
e2e338929f Fix Whitespace 2014-03-06 19:03:26 +01:00
8162aff8cf Add DNS Bootstrapping 2014-03-06 19:01:38 +01:00
ea873304ca No longer dev 2014-03-06 13:10:39 +01:00
f80984491a Removed comments 2014-03-06 13:09:55 +01:00
e7770b2332 Added miner state 2014-03-06 13:06:54 +01:00
be543a6d17 Removed comments 2014-03-06 13:03:24 +01:00
6c6e8b0fd7 Renamed block manager to state manager 2014-03-05 10:57:32 +01:00
79320e2868 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop 2014-03-05 10:44:57 +01:00
92f2abdf76 Partially refactored server/txpool/block manager/block chain
The Ethereum structure now complies to a EthManager interface which is
being used by the tx pool, block manager and block chain in order to
gain access to each other. It's become simpeler.
TODO: BlockManager => StateManager
2014-03-05 10:42:51 +01:00
c1de7bcec5 Merge pull request #10 from mquandalle/patch-1
Rename .travil.yml to .travis.yml
2014-03-04 11:28:01 +01:00
8577e9116e Rename .travil.yml to .travis.yml 2014-03-03 18:13:08 +01:00
5b1613d65b Merge branch 'master' into develop 2014-03-03 11:35:35 +01:00
c1d0ea7366 Updated protocol version to 7 2014-03-03 11:34:04 +01:00
9d492b0509 Renamed Address to Account 2014-03-03 11:05:12 +01:00
bfed1c7cac Trie's are no longer referenced directly but through State instead 2014-03-03 11:03:16 +01:00
d2bc57cd34 PoC reactor pattern 2014-03-03 00:55:10 +01:00
d65b4cd0dd Updated block to use state instead of trie directly 2014-03-02 20:42:05 +01:00
f1b354e6aa Reactor implemented 2014-03-02 02:22:20 +01:00
d7c5936ac4 Merge branch 'hotfix/0.3.1' into develop 2014-02-28 16:46:12 +01:00
ceada15290 Merge branch 'hotfix/0.3.1' 2014-02-28 16:45:54 +01:00
b462ca4aad Bump 2014-02-28 16:45:46 +01:00
601340bd46 Fixed shutting down 2014-02-28 16:45:29 +01:00
8ee8ec8a36 Merge branch 'develop' of https://github.com/james-c/eth-go into james-c-develop
Conflicts:
	ethdb/database.go
2014-02-28 12:43:31 +01:00
7de2c7f176 Merge branch 'release/0.3.0' into develop 2014-02-28 12:21:19 +01:00
839bd73fbb Merge branch 'release/0.3.0' 2014-02-28 12:21:12 +01:00
3f7ec1a83f Conform to Db interface 2014-02-28 12:19:45 +01:00
8fa19664e6 Added BigCopy 2014-02-28 12:19:21 +01:00
9d06f9e6fb Updated readme#trie 2014-02-28 12:19:01 +01:00
c0fcefa3a0 Added a GetKeys method to support multiple accounts 2014-02-28 12:18:41 +01:00
c9f3d1c00b leveldb API changed for NewIterator. Fixes #20 2014-02-28 10:36:06 +01:00
179255c3fe Merge branch 'goleveldb_fix' into develop 2014-02-26 15:28:27 +00:00
4fad5958d0 Fix error in call to NewIterator function
Change number of args passed to NewIterator in print function to reflect changes in the goleveldb project.
2014-02-26 15:26:39 +00:00
e98b53bbef WIP Observing pattern 2014-02-25 11:22:27 +01:00
4b8c50e2cd Deprication 2014-02-25 11:22:18 +01:00
1e7b3cbb13 Removed debug log 2014-02-25 11:22:05 +01:00
ce07d9bb4c Error logging on tx processing 2014-02-25 11:21:49 +01:00
507fc7b9d1 Length checking when fetching contract. Contract always have 3 fields 2014-02-25 11:21:35 +01:00
4f4175a3e2 Addad db name for new ldb 2014-02-25 11:21:03 +01:00
c7e73ba12d Added currency converting 2014-02-25 11:20:24 +01:00
b30b9ab8cb Fixed a minor issue where a string is expected but returns slice 2014-02-25 10:50:53 +01:00
0afdedb01a Some log statements changed to the default logger 2014-02-24 13:50:52 +01:00
6c7255cde2 Fixed a minor issue on crashed contracts 2014-02-24 13:15:34 +01:00
f2234264ed Merge pull request #8 from josephyzhou/develop
parse returns byte array instead of string now
2014-02-24 12:53:30 +01:00
95a8ebc249 Changed MakeContract on block
MakeContract in Block is now using the MakeContract defined in
contract.go
2014-02-24 12:45:21 +01:00
88a9c62fcc Proper tests 2014-02-24 12:44:29 +01:00
b29c1eecd1 Removed debug print 2014-02-24 12:44:18 +01:00
d69db6e617 Removed compiling from the transaction 2014-02-24 12:13:42 +01:00
d8b5bbd48c Added compile 2014-02-24 12:13:22 +01:00
22e2c3429b Infof rather than infoln 2014-02-24 12:12:53 +01:00
4cc5b03137 Added opcodes 2014-02-24 12:12:32 +01:00
a3fb7008b2 Added make contract 2014-02-24 12:12:24 +01:00
55c1c220d0 Added delete to database interfaces 2014-02-24 12:12:01 +01:00
5971c82094 Updated opcodes ... again 2014-02-24 12:11:42 +01:00
1a98bbf1c8 Added a trie iterator 2014-02-24 12:11:00 +01:00
377c995103 Separated the VM from the block manager and added states 2014-02-24 12:10:45 +01:00
8ecb24f114 parse now returns byte[] instead of string 2014-02-23 14:43:18 -08:00
3a45cdeaf9 Moved txpool start to initialisation method of ethereumm 2014-02-23 01:57:45 +01:00
a4a4ffbeff Moved address 2014-02-23 01:57:22 +01:00
f5737b929a Added a secondary processor 2014-02-23 01:57:04 +01:00
c66cf95b40 Added address states for storing a session based address 2014-02-23 01:56:48 +01:00
73b9ae9579 Updated some of the log statements to use the ethutil logger 2014-02-22 01:53:25 +01:00
4bfd717ba2 Added the ability to extend the logger with more sub systems 2014-02-22 01:53:09 +01:00
cca8585554 Get a chain of blocks made simple 2014-02-21 13:05:59 +01:00
18cc35338a Fixed contract running 2014-02-21 12:37:16 +01:00
681eacaa7f Removed old instruction code 2014-02-21 12:37:06 +01:00
b20c0b1d59 Removed all old code 2014-02-21 12:36:41 +01:00
f2a1260294 Nil is also considered empty 2014-02-21 12:36:22 +01:00
06ea7fc830 re: Added contract fees 2014-02-20 23:11:17 +01:00
ed05779adb Updated fees 2014-02-20 23:10:43 +01:00
8f69c2ac45 Added contract addr acessors 2014-02-20 23:10:36 +01:00
504d356232 Added peek(n) 2014-02-20 23:10:16 +01:00
059ad35215 Type checking 2014-02-20 23:10:05 +01:00
9bc5c4a0c5 Long over due Trie delete implemented 2014-02-20 14:40:00 +01:00
4afb624c45 WIP state object 2014-02-19 16:28:08 +01:00
39b6eaf51c Debug logging functions 2014-02-19 16:27:35 +01:00
d4cc125456 Added more logging functions 2014-02-19 16:27:22 +01:00
dc994b3518 Changed fee structure 2014-02-19 16:27:08 +01:00
8e7daec886 Added fees and debugging 2014-02-19 16:26:55 +01:00
b3da104e56 Corrected contract addresses 2014-02-19 16:26:35 +01:00
0936e5ccf5 Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
Conflicts:
	ethutil/config.go
2014-02-19 11:40:02 +01:00
531b3a96eb Merge pull request #5 from sdboyer/iotas
Idiomatic go: use iotas for const declarations
2014-02-19 11:38:02 +01:00
3dae732f36 Merge pull request #6 from sdboyer/genisis
Fix typo(?) in naming - s/GenisisHeader/GenesisHeader/
2014-02-19 11:36:53 +01:00
1e241e3a61 Merge pull request #7 from sdboyer/vet-fixes
Fix a couple errors from go vet
2014-02-19 11:36:23 +01:00
24f2b2afc3 Running contracts fixed 2014-02-19 11:35:17 +01:00
357b4bc14c Add comment explaining why iota is not used. 2014-02-18 17:24:44 -05:00
5adbd39946 Express bit flag constants using iota bitshift. 2014-02-18 17:20:41 -05:00
6dac014978 Fix a couple errors from go vet 2014-02-18 10:47:09 -05:00
4d405f6654 s/GenisisHeader/GenesisHeader/ 2014-02-18 10:40:58 -05:00
bbcf304b99 Merge pull request #3 from josephyzhou/develop
Migrated to here
2014-02-18 16:04:45 +01:00
c866fcc5b3 Added new address 2014-02-18 12:10:21 +01:00
d7eca7bcc1 Rlp update 2014-02-18 01:34:06 +01:00
68028f492f Fixed block handling 2014-02-18 01:33:26 +01:00
8629d9a418 String changed and removed some debugging code 2014-02-18 01:33:15 +01:00
c7623c3165 Changed debug messages 2014-02-18 01:32:39 +01:00
ba95849097 Added hex method 2014-02-18 01:32:20 +01:00
bb3e28310e If sender is receiver only subtract the fee 2014-02-18 01:31:51 +01:00
a5b7279cb5 Changed uncle block fee as to what it should be 2014-02-18 01:31:31 +01:00
c5b009ba6f new line 2014-02-17 15:47:33 -08:00
e72a782bf0 adding compact decode tests 2014-02-17 15:46:16 -08:00
7413552a28 Root should reset on undo 2014-02-17 20:40:33 +01:00
b7a636b894 Values should accept bytes as valid string output 2014-02-17 20:29:54 +01:00
e5b97fe03e Added proper error message 2014-02-16 20:33:23 +01:00
2ea05292c0 Added proper name :) 2014-02-16 20:33:07 +01:00
e4a6ee3d7f Added dirty tracking on the cache 2014-02-16 20:32:56 +01:00
7264044122 Added a few tests 2014-02-16 20:31:02 +01:00
f1d6f1bd17 Removed Reset 2014-02-16 20:30:50 +01:00
c95a27e394 Added more tests 2014-02-16 20:30:33 +01:00
066940f134 Defer undo on the current block's state 2014-02-16 20:30:21 +01:00
07c12f0b92 Added trie tests, value tests 2014-02-15 13:21:11 +01:00
5883446b21 Fixed test 2014-02-15 12:41:17 +01:00
9bcb3d2216 Fixed test 2014-02-15 12:40:19 +01:00
424b0b8bac Merge branch 'hotfix/0.2.2-1' into develop 2014-02-15 12:12:01 +01:00
30ee32a725 Merge branch 'hotfix/0.2.2-1' 2014-02-15 12:11:53 +01:00
f5fbbb147f Removed debug message 2014-02-15 12:11:40 +01:00
147a74dff2 Merge branch 'release/0.2.2' into develop 2014-02-15 11:53:02 +01:00
60afd02e59 Merge branch 'release/0.2.2' 2014-02-15 11:52:38 +01:00
fd1aa869e1 Bumped version number 2014-02-15 11:52:28 +01:00
334c41d088 Added MIT license 2014-02-15 11:49:53 +01:00
4a656eff7b Added git flow explanation 2014-02-15 11:49:39 +01:00
73fd358d94 Removed RlpValue in favour of Value 2014-02-15 01:34:18 +01:00
f247f0c518 Added readme 2014-02-15 00:04:46 +01:00
f6d1bfe45b The great merge 2014-02-14 23:56:09 +01:00
c2fb9f06ad Refactoring RlpValue => Value 2014-02-13 15:12:16 +01:00
67de76c217 Put leveldb 2014-02-11 20:09:58 +01:00
02acef23d5 Interop! 2014-02-11 18:46:28 +01:00
5a83114efd Seed bootstrapping added 2014-02-10 20:59:31 +01:00
42123b4396 Fixed peer handling 2014-02-10 16:41:36 +01:00
0ae6a38825 Database 2014-02-10 16:04:57 +01:00
8ab6c53231 Reversed back 2014-02-10 13:59:05 +01:00
1d26ae2dea Changed client id 2014-02-10 11:45:08 +01:00
d2edc2bbf4 Added some loggers 2014-02-10 11:36:49 +01:00
8db7d791f0 Corrected version number in error log 2014-02-10 11:20:42 +01:00
a50b4f6b11 Forgot to bump the version 2014-02-10 01:15:14 +01:00
156495732b level db back in 2014-02-10 01:10:02 +01:00
3c4fb01da3 Version 3 and added added catch up 2014-02-10 01:09:12 +01:00
c00b1dd508 Self connect on handshake 2014-02-09 23:58:59 +01:00
0de31a3898 Fixed self connect through public key discovery.
Bumped protocol version number
2014-02-09 23:34:33 +01:00
24349bc431 Changed peer format 2014-02-08 21:02:42 +01:00
1f7b13ff4e Switched over to leveldb instead of memdb 2014-02-08 21:02:09 +01:00
04c00f40f0 Fixed value 2014-02-06 13:27:57 +01:00
9e9b7a520e Do not quit if upnp fails 2014-02-03 17:26:37 +01:00
f995f5763b Properly encode tx 2014-02-03 01:12:44 +01:00
6292c5ad5a Transaction processing 2014-02-03 01:10:10 +01:00
a9a564c226 removed self connect log 2014-02-02 20:54:13 +01:00
04b6e413d9 Encode caps as byte 2014-02-02 20:06:37 +01:00
aa9341570b Disconnection reasons 2014-02-02 20:00:09 +01:00
f4a96ca588 Removed the seed peer option from start 2014-02-02 19:46:37 +01:00
48b41862ef UPnP Support 2014-02-02 19:44:47 +01:00
3f503ffc7f Implemented support for UPnP 2014-02-02 19:22:39 +01:00
ae0d4eb7aa removed upnp 2014-02-02 16:29:13 +01:00
cb8a7d979d upnp test 2014-02-02 16:15:39 +01:00
b70fe3a9be Reverted back to messages 2014-02-02 01:39:06 +01:00
dfa778fed6 UPNP wip 2014-02-01 21:30:54 +01:00
8c4746a3df (un)pack addr 2014-01-31 20:01:28 +01:00
ce69334988 For the testnet always 30303 for now to make it easy 2014-01-31 13:37:16 +01:00
8c09602a8b Self connect 2014-01-31 13:03:13 +01:00
da66eddfcc Get peers returns now both in and outbound peers 2014-01-31 11:57:56 +01:00
dfa38b3f91 Peer connection checking 2014-01-31 11:18:10 +01:00
36f221dbe7 Don't connect to peers that are already connected 2014-01-31 01:12:48 +01:00
7f100e9610 Self connect detect 2014-01-31 00:56:32 +01:00
7ccf51fd30 Updated seed peers 2014-01-30 23:48:52 +01:00
3e400739a7 Implemented get chain msg 2014-01-28 15:35:44 +01:00
4a82230de5 Switched port and removed logging 2014-01-27 22:13:46 +01:00
884f792871 Removed default connection 2014-01-27 15:34:50 +01:00
7931c6624c Graceful shutdown of peers 2014-01-25 17:13:33 +01:00
1b7cba1878 Updated peers 2014-01-24 17:48:21 +01:00
233f5200ef Data send over the wire shouldn't be RLPed more then once 2014-01-23 22:32:50 +01:00
878e796c0a Updated packages 2014-01-23 20:55:23 +01:00
2b32f47d2c Initial commit bootstrapping package 2014-01-23 20:14:01 +01:00
1328 changed files with 2707212 additions and 6265 deletions

12
.gitignore vendored
View File

@ -9,6 +9,14 @@
*un~
.DS_Store
*/**/.DS_Store
ethereum/ethereum
ethereal/ethereal
.ethtest
#*
.#*
*#
*~
.project
.settings
cmd/ethereum/ethereum
cmd/mist/mist

12
.mailmap Normal file
View File

@ -0,0 +1,12 @@
Jeffrey Wilcke <jeffrey@ethereum.org>
Jeffrey Wilcke <jeffrey@ethereum.org> <geffobscura@gmail.com>
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@obscura.com>
Jeffrey Wilcke <jeffrey@ethereum.org> <obscuren@users.noreply.github.com>
Viktor Trón <viktor.tron@gmail.com>
Joseph Goulden <joegoulden@gmail.com>
Nick Savers <nicksavers@gmail.com>
Maran Hidskes <maran.hidskes@gmail.com>

View File

@ -1,4 +1,24 @@
before_install: sudo apt-get install libgmp3-dev
language: go
go:
- 1.2
- 1.4.1
before_install:
- sudo add-apt-repository ppa:beineri/opt-qt54 -y
- sudo apt-get update -qq
- sudo apt-get install -yqq libgmp3-dev libreadline6-dev qt54quickcontrols qt54webengine
install:
# - go get golang.org/x/tools/cmd/vet
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
- go get github.com/mattn/goveralls
before_script:
# - go vet ./...
# - go test -race ./...
script:
- ./gocoverage.sh
after_success:
- if [ "$COVERALLS_TOKEN" ]; then goveralls -coverprofile=profile.cov -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
env:
global:
- PKG_CONFIG_PATH=/opt/qt54/lib/pkgconfig
- LD_LIBRARY_PATH=/opt/qt54/lib
- secure: "U2U1AmkU4NJBgKR/uUAebQY87cNL0+1JHjnLOmmXwxYYyj5ralWb1aSuSH3qSXiT93qLBmtaUkuv9fberHVqrbAeVlztVdUsKAq7JMQH+M99iFkC9UiRMqHmtjWJ0ok4COD1sRYixxi21wb/JrMe3M1iL4QJVS61iltjHhVdM64="

40
Dockerfile Normal file
View File

@ -0,0 +1,40 @@
FROM ubuntu:14.04.1
## Environment setup
ENV HOME /root
ENV GOPATH /root/go
ENV PATH /root/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
RUN mkdir -p /root/go
ENV DEBIAN_FRONTEND noninteractive
## Install base dependencies
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y git mercurial build-essential software-properties-common wget pkg-config libgmp3-dev libreadline6-dev libpcre3-dev libpcre++-dev
## Install Qt5.4 (not required for CLI)
# RUN add-apt-repository ppa:beineri/opt-qt54-trusty -y
# RUN apt-get update -y
# RUN apt-get install -y qt54quickcontrols qt54webengine mesa-common-dev libglu1-mesa-dev
# ENV PKG_CONFIG_PATH /opt/qt54/lib/pkgconfig
# Install Golang
RUN wget https://storage.googleapis.com/golang/go1.4.1.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go*.tar.gz && go version
# this is a workaround, to make sure that docker's cache is invalidated whenever the git repo changes
ADD https://api.github.com/repos/ethereum/go-ethereum/git/refs/heads/develop file_does_not_exist
## Fetch and install go-ethereum
RUN go get -v github.com/tools/godep
RUN go get -v -d github.com/ethereum/go-ethereum/...
WORKDIR $GOPATH/src/github.com/ethereum/go-ethereum
RUN git checkout develop
RUN godep restore
RUN go install -v ./cmd/ethereum
## Run & expose JSON RPC
ENTRYPOINT ["ethereum", "-rpc=true", "-rpcport=8545"]
EXPOSE 8545

118
Godeps/Godeps.json generated Normal file
View File

@ -0,0 +1,118 @@
{
"ImportPath": "github.com/ethereum/go-ethereum",
"GoVersion": "go1.4.1",
"Packages": [
"./..."
],
"Deps": [
{
"ImportPath": "bitbucket.org/kardianos/osext",
"Comment": "null-13",
"Rev": "5d3ddcf53a508cc2f7404eaebf546ef2cb5cdb6e"
},
{
"ImportPath": "code.google.com/p/go-uuid/uuid",
"Comment": "null-12",
"Rev": "7dda39b2e7d5e265014674c5af696ba4186679e9"
},
{
"ImportPath": "code.google.com/p/snappy-go/snappy",
"Comment": "null-15",
"Rev": "12e4b4183793ac4b061921e7980845e750679fd0"
},
{
"ImportPath": "github.com/ethereum/serpent-go",
"Rev": "5767a0dbd759d313df3f404dadb7f98d7ab51443"
},
{
"ImportPath": "github.com/howeyc/fsnotify",
"Comment": "v0.9.0-11-g6b1ef89",
"Rev": "6b1ef893dc11e0447abda6da20a5203481878dda"
},
{
"ImportPath": "github.com/huin/goupnp",
"Rev": "4191d8a85005844ea202fde52799681971b12dfe"
},
{
"ImportPath": "github.com/jackpal/go-nat-pmp",
"Rev": "a45aa3d54aef73b504e15eb71bea0e5565b5e6e1"
},
{
"ImportPath": "github.com/obscuren/otto",
"Rev": "cf13cc4228c5e5ce0fe27a7aea90bc10091c4f19"
},
{
"ImportPath": "github.com/obscuren/qml",
"Rev": "c288002b52e905973b131089a8a7c761d4a2c36a"
},
{
"ImportPath": "github.com/rakyll/globalconf",
"Rev": "415abc325023f1a00cd2d9fa512e0e71745791a2"
},
{
"ImportPath": "github.com/rakyll/goini",
"Rev": "907cca0f578a5316fb864ec6992dc3d9730ec58c"
},
{
"ImportPath": "github.com/robertkrimen/otto/ast",
"Rev": "dea31a3d392779af358ec41f77a07fcc7e9d04ba"
},
{
"ImportPath": "github.com/robertkrimen/otto/dbg",
"Rev": "dea31a3d392779af358ec41f77a07fcc7e9d04ba"
},
{
"ImportPath": "github.com/robertkrimen/otto/file",
"Rev": "dea31a3d392779af358ec41f77a07fcc7e9d04ba"
},
{
"ImportPath": "github.com/robertkrimen/otto/parser",
"Rev": "dea31a3d392779af358ec41f77a07fcc7e9d04ba"
},
{
"ImportPath": "github.com/robertkrimen/otto/registry",
"Rev": "dea31a3d392779af358ec41f77a07fcc7e9d04ba"
},
{
"ImportPath": "github.com/robertkrimen/otto/token",
"Rev": "dea31a3d392779af358ec41f77a07fcc7e9d04ba"
},
{
"ImportPath": "github.com/syndtr/goleveldb/leveldb",
"Rev": "832fa7ed4d28545eab80f19e1831fc004305cade"
},
{
"ImportPath": "golang.org/x/crypto/pbkdf2",
"Rev": "4ed45ec682102c643324fae5dff8dab085b6c300"
},
{
"ImportPath": "golang.org/x/crypto/ripemd160",
"Rev": "4ed45ec682102c643324fae5dff8dab085b6c300"
},
{
"ImportPath": "golang.org/x/crypto/scrypt",
"Rev": "4ed45ec682102c643324fae5dff8dab085b6c300"
},
{
"ImportPath": "golang.org/x/net/websocket",
"Rev": "59b0df9b1f7abda5aab0495ee54f408daf182ce7"
},
{
"ImportPath": "gopkg.in/check.v1",
"Rev": "64131543e7896d5bcc6bd5a76287eb75ea96c673"
},
{
"ImportPath": "gopkg.in/fatih/set.v0",
"Comment": "v0.1.0-3-g27c4092",
"Rev": "27c40922c40b43fe04554d8223a402af3ea333f3"
},
{
"ImportPath": "gopkg.in/qml.v1/cdata",
"Rev": "1116cb9cd8dee23f8d444ded354eb53122739f99"
},
{
"ImportPath": "gopkg.in/qml.v1/gl/glbase",
"Rev": "1116cb9cd8dee23f8d444ded354eb53122739f99"
}
]
}

5
Godeps/Readme generated Normal file
View File

@ -0,0 +1,5 @@
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.

2
Godeps/_workspace/.gitignore generated vendored Normal file
View File

@ -0,0 +1,2 @@
/pkg
/bin

View File

@ -0,0 +1,20 @@
Copyright (c) 2012 Daniel Theophanes
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.

View File

@ -0,0 +1,32 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Extensions to the standard "os" package.
package osext
import "path/filepath"
// Executable returns an absolute path that can be used to
// re-invoke the current program.
// It may not be valid after the current program exits.
func Executable() (string, error) {
p, err := executable()
return filepath.Clean(p), err
}
// Returns same path as Executable, returns just the folder
// path. Excludes the executable name.
func ExecutableFolder() (string, error) {
p, err := Executable()
if err != nil {
return "", err
}
folder, _ := filepath.Split(p)
return folder, nil
}
// Depricated. Same as Executable().
func GetExePath() (exePath string, err error) {
return Executable()
}

View File

@ -0,0 +1,20 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package osext
import (
"syscall"
"os"
"strconv"
)
func executable() (string, error) {
f, err := os.Open("/proc/" + strconv.Itoa(os.Getpid()) + "/text")
if err != nil {
return "", err
}
defer f.Close()
return syscall.Fd2path(int(f.Fd()))
}

View File

@ -0,0 +1,25 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build linux netbsd openbsd
package osext
import (
"errors"
"os"
"runtime"
)
func executable() (string, error) {
switch runtime.GOOS {
case "linux":
return os.Readlink("/proc/self/exe")
case "netbsd":
return os.Readlink("/proc/curproc/exe")
case "openbsd":
return os.Readlink("/proc/curproc/file")
}
return "", errors.New("ExecPath not implemented for " + runtime.GOOS)
}

View File

@ -0,0 +1,79 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin freebsd
package osext
import (
"os"
"path/filepath"
"runtime"
"syscall"
"unsafe"
)
var initCwd, initCwdErr = os.Getwd()
func executable() (string, error) {
var mib [4]int32
switch runtime.GOOS {
case "freebsd":
mib = [4]int32{1 /* CTL_KERN */, 14 /* KERN_PROC */, 12 /* KERN_PROC_PATHNAME */, -1}
case "darwin":
mib = [4]int32{1 /* CTL_KERN */, 38 /* KERN_PROCARGS */, int32(os.Getpid()), -1}
}
n := uintptr(0)
// Get length.
_, _, errNum := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), 4, 0, uintptr(unsafe.Pointer(&n)), 0, 0)
if errNum != 0 {
return "", errNum
}
if n == 0 { // This shouldn't happen.
return "", nil
}
buf := make([]byte, n)
_, _, errNum = syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(unsafe.Pointer(&mib[0])), 4, uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&n)), 0, 0)
if errNum != 0 {
return "", errNum
}
if n == 0 { // This shouldn't happen.
return "", nil
}
for i, v := range buf {
if v == 0 {
buf = buf[:i]
break
}
}
var err error
execPath := string(buf)
// execPath will not be empty due to above checks.
// Try to get the absolute path if the execPath is not rooted.
if execPath[0] != '/' {
execPath, err = getAbs(execPath)
if err != nil {
return execPath, err
}
}
// For darwin KERN_PROCARGS may return the path to a symlink rather than the
// actual executable.
if runtime.GOOS == "darwin" {
if execPath, err = filepath.EvalSymlinks(execPath); err != nil {
return execPath, err
}
}
return execPath, nil
}
func getAbs(execPath string) (string, error) {
if initCwdErr != nil {
return execPath, initCwdErr
}
// The execPath may begin with a "../" or a "./" so clean it first.
// Join the two paths, trailing and starting slashes undetermined, so use
// the generic Join function.
return filepath.Join(initCwd, filepath.Clean(execPath)), nil
}

View File

@ -0,0 +1,79 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin linux freebsd netbsd windows
package osext
import (
"fmt"
"os"
oexec "os/exec"
"path/filepath"
"runtime"
"testing"
)
const execPath_EnvVar = "OSTEST_OUTPUT_EXECPATH"
func TestExecPath(t *testing.T) {
ep, err := Executable()
if err != nil {
t.Fatalf("ExecPath failed: %v", err)
}
// we want fn to be of the form "dir/prog"
dir := filepath.Dir(filepath.Dir(ep))
fn, err := filepath.Rel(dir, ep)
if err != nil {
t.Fatalf("filepath.Rel: %v", err)
}
cmd := &oexec.Cmd{}
// make child start with a relative program path
cmd.Dir = dir
cmd.Path = fn
// forge argv[0] for child, so that we can verify we could correctly
// get real path of the executable without influenced by argv[0].
cmd.Args = []string{"-", "-test.run=XXXX"}
cmd.Env = []string{fmt.Sprintf("%s=1", execPath_EnvVar)}
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("exec(self) failed: %v", err)
}
outs := string(out)
if !filepath.IsAbs(outs) {
t.Fatalf("Child returned %q, want an absolute path", out)
}
if !sameFile(outs, ep) {
t.Fatalf("Child returned %q, not the same file as %q", out, ep)
}
}
func sameFile(fn1, fn2 string) bool {
fi1, err := os.Stat(fn1)
if err != nil {
return false
}
fi2, err := os.Stat(fn2)
if err != nil {
return false
}
return os.SameFile(fi1, fi2)
}
func init() {
if e := os.Getenv(execPath_EnvVar); e != "" {
// first chdir to another path
dir := "/"
if runtime.GOOS == "windows" {
dir = filepath.VolumeName(".")
}
os.Chdir(dir)
if ep, err := Executable(); err != nil {
fmt.Fprint(os.Stderr, "ERROR: ", err)
} else {
fmt.Fprint(os.Stderr, ep)
}
os.Exit(0)
}
}

View File

@ -0,0 +1,34 @@
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package osext
import (
"syscall"
"unicode/utf16"
"unsafe"
)
var (
kernel = syscall.MustLoadDLL("kernel32.dll")
getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW")
)
// GetModuleFileName() with hModule = NULL
func executable() (exePath string, err error) {
return getModuleFileName()
}
func getModuleFileName() (string, error) {
var n uint32
b := make([]uint16, syscall.MAX_PATH)
size := uint32(len(b))
r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size))
n = uint32(r0)
if n == 0 {
return "", e1
}
return string(utf16.Decode(b[0:n])), nil
}

View File

@ -0,0 +1,27 @@
Copyright (c) 2009 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,84 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"encoding/binary"
"fmt"
"os"
)
// A Domain represents a Version 2 domain
type Domain byte
// Domain constants for DCE Security (Version 2) UUIDs.
const (
Person = Domain(0)
Group = Domain(1)
Org = Domain(2)
)
// NewDCESecurity returns a DCE Security (Version 2) UUID.
//
// The domain should be one of Person, Group or Org.
// On a POSIX system the id should be the users UID for the Person
// domain and the users GID for the Group. The meaning of id for
// the domain Org or on non-POSIX systems is site defined.
//
// For a given domain/id pair the same token may be returned for up to
// 7 minutes and 10 seconds.
func NewDCESecurity(domain Domain, id uint32) UUID {
uuid := NewUUID()
if uuid != nil {
uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
uuid[9] = byte(domain)
binary.BigEndian.PutUint32(uuid[0:], id)
}
return uuid
}
// NewDCEPerson returns a DCE Security (Version 2) UUID in the person
// domain with the id returned by os.Getuid.
//
// NewDCEPerson(Person, uint32(os.Getuid()))
func NewDCEPerson() UUID {
return NewDCESecurity(Person, uint32(os.Getuid()))
}
// NewDCEGroup returns a DCE Security (Version 2) UUID in the group
// domain with the id returned by os.Getgid.
//
// NewDCEGroup(Group, uint32(os.Getgid()))
func NewDCEGroup() UUID {
return NewDCESecurity(Group, uint32(os.Getgid()))
}
// Domain returns the domain for a Version 2 UUID or false.
func (uuid UUID) Domain() (Domain, bool) {
if v, _ := uuid.Version(); v != 2 {
return 0, false
}
return Domain(uuid[9]), true
}
// Id returns the id for a Version 2 UUID or false.
func (uuid UUID) Id() (uint32, bool) {
if v, _ := uuid.Version(); v != 2 {
return 0, false
}
return binary.BigEndian.Uint32(uuid[0:4]), true
}
func (d Domain) String() string {
switch d {
case Person:
return "Person"
case Group:
return "Group"
case Org:
return "Org"
}
return fmt.Sprintf("Domain%d", int(d))
}

View File

@ -0,0 +1,8 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// The uuid package generates and inspects UUIDs.
//
// UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services.
package uuid

View File

@ -0,0 +1,53 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"crypto/md5"
"crypto/sha1"
"hash"
)
// Well known Name Space IDs and UUIDs
var (
NameSpace_DNS = Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8")
NameSpace_URL = Parse("6ba7b811-9dad-11d1-80b4-00c04fd430c8")
NameSpace_OID = Parse("6ba7b812-9dad-11d1-80b4-00c04fd430c8")
NameSpace_X500 = Parse("6ba7b814-9dad-11d1-80b4-00c04fd430c8")
NIL = Parse("00000000-0000-0000-0000-000000000000")
)
// NewHash returns a new UUID dervied from the hash of space concatenated with
// data generated by h. The hash should be at least 16 byte in length. The
// first 16 bytes of the hash are used to form the UUID. The version of the
// UUID will be the lower 4 bits of version. NewHash is used to implement
// NewMD5 and NewSHA1.
func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID {
h.Reset()
h.Write(space)
h.Write([]byte(data))
s := h.Sum(nil)
uuid := make([]byte, 16)
copy(uuid, s)
uuid[6] = (uuid[6] & 0x0f) | uint8((version&0xf)<<4)
uuid[8] = (uuid[8] & 0x3f) | 0x80 // RFC 4122 variant
return uuid
}
// NewMD5 returns a new MD5 (Version 3) UUID based on the
// supplied name space and data.
//
// NewHash(md5.New(), space, data, 3)
func NewMD5(space UUID, data []byte) UUID {
return NewHash(md5.New(), space, data, 3)
}
// NewSHA1 returns a new SHA1 (Version 5) UUID based on the
// supplied name space and data.
//
// NewHash(sha1.New(), space, data, 5)
func NewSHA1(space UUID, data []byte) UUID {
return NewHash(sha1.New(), space, data, 5)
}

View File

@ -0,0 +1,101 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import "net"
var (
interfaces []net.Interface // cached list of interfaces
ifname string // name of interface being used
nodeID []byte // hardware for version 1 UUIDs
)
// NodeInterface returns the name of the interface from which the NodeID was
// derived. The interface "user" is returned if the NodeID was set by
// SetNodeID.
func NodeInterface() string {
return ifname
}
// SetNodeInterface selects the hardware address to be used for Version 1 UUIDs.
// If name is "" then the first usable interface found will be used or a random
// Node ID will be generated. If a named interface cannot be found then false
// is returned.
//
// SetNodeInterface never fails when name is "".
func SetNodeInterface(name string) bool {
if interfaces == nil {
var err error
interfaces, err = net.Interfaces()
if err != nil && name != "" {
return false
}
}
for _, ifs := range interfaces {
if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) {
if setNodeID(ifs.HardwareAddr) {
ifname = ifs.Name
return true
}
}
}
// We found no interfaces with a valid hardware address. If name
// does not specify a specific interface generate a random Node ID
// (section 4.1.6)
if name == "" {
if nodeID == nil {
nodeID = make([]byte, 6)
}
randomBits(nodeID)
return true
}
return false
}
// NodeID returns a slice of a copy of the current Node ID, setting the Node ID
// if not already set.
func NodeID() []byte {
if nodeID == nil {
SetNodeInterface("")
}
nid := make([]byte, 6)
copy(nid, nodeID)
return nid
}
// SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes
// of id are used. If id is less than 6 bytes then false is returned and the
// Node ID is not set.
func SetNodeID(id []byte) bool {
if setNodeID(id) {
ifname = "user"
return true
}
return false
}
func setNodeID(id []byte) bool {
if len(id) < 6 {
return false
}
if nodeID == nil {
nodeID = make([]byte, 6)
}
copy(nodeID, id)
return true
}
// NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is
// not valid. The NodeID is only well defined for version 1 and 2 UUIDs.
func (uuid UUID) NodeID() []byte {
if len(uuid) != 16 {
return nil
}
node := make([]byte, 6)
copy(node, uuid[10:])
return node
}

View File

@ -0,0 +1,132 @@
// Copyright 2014 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"encoding/binary"
"sync"
"time"
)
// A Time represents a time as the number of 100's of nanoseconds since 15 Oct
// 1582.
type Time int64
const (
lillian = 2299160 // Julian day of 15 Oct 1582
unix = 2440587 // Julian day of 1 Jan 1970
epoch = unix - lillian // Days between epochs
g1582 = epoch * 86400 // seconds between epochs
g1582ns100 = g1582 * 10000000 // 100s of a nanoseconds between epochs
)
var (
mu sync.Mutex
lasttime uint64 // last time we returned
clock_seq uint16 // clock sequence for this run
timeNow = time.Now // for testing
)
// UnixTime converts t the number of seconds and nanoseconds using the Unix
// epoch of 1 Jan 1970.
func (t Time) UnixTime() (sec, nsec int64) {
sec = int64(t - g1582ns100)
nsec = (sec % 10000000) * 100
sec /= 10000000
return sec, nsec
}
// GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and
// adjusts the clock sequence as needed. An error is returned if the current
// time cannot be determined.
func GetTime() (Time, error) {
defer mu.Unlock()
mu.Lock()
return getTime()
}
func getTime() (Time, error) {
t := timeNow()
// If we don't have a clock sequence already, set one.
if clock_seq == 0 {
setClockSequence(-1)
}
now := uint64(t.UnixNano()/100) + g1582ns100
// If time has gone backwards with this clock sequence then we
// increment the clock sequence
if now <= lasttime {
clock_seq = ((clock_seq + 1) & 0x3fff) | 0x8000
}
lasttime = now
return Time(now), nil
}
// ClockSequence returns the current clock sequence, generating one if not
// already set. The clock sequence is only used for Version 1 UUIDs.
//
// The uuid package does not use global static storage for the clock sequence or
// the last time a UUID was generated. Unless SetClockSequence a new random
// clock sequence is generated the first time a clock sequence is requested by
// ClockSequence, GetTime, or NewUUID. (section 4.2.1.1) sequence is generated
// for
func ClockSequence() int {
defer mu.Unlock()
mu.Lock()
return clockSequence()
}
func clockSequence() int {
if clock_seq == 0 {
setClockSequence(-1)
}
return int(clock_seq & 0x3fff)
}
// SetClockSeq sets the clock sequence to the lower 14 bits of seq. Setting to
// -1 causes a new sequence to be generated.
func SetClockSequence(seq int) {
defer mu.Unlock()
mu.Lock()
setClockSequence(seq)
}
func setClockSequence(seq int) {
if seq == -1 {
var b [2]byte
randomBits(b[:]) // clock sequence
seq = int(b[0])<<8 | int(b[1])
}
old_seq := clock_seq
clock_seq = uint16(seq&0x3fff) | 0x8000 // Set our variant
if old_seq != clock_seq {
lasttime = 0
}
}
// Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in
// uuid. It returns false if uuid is not valid. The time is only well defined
// for version 1 and 2 UUIDs.
func (uuid UUID) Time() (Time, bool) {
if len(uuid) != 16 {
return 0, false
}
time := int64(binary.BigEndian.Uint32(uuid[0:4]))
time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32
time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48
return Time(time), true
}
// ClockSequence returns the clock sequence encoded in uuid. It returns false
// if uuid is not valid. The clock sequence is only well defined for version 1
// and 2 UUIDs.
func (uuid UUID) ClockSequence() (int, bool) {
if len(uuid) != 16 {
return 0, false
}
return int(binary.BigEndian.Uint16(uuid[8:10])) & 0x3fff, true
}

View File

@ -0,0 +1,43 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"io"
)
// randomBits completely fills slice b with random data.
func randomBits(b []byte) {
if _, err := io.ReadFull(rander, b); err != nil {
panic(err.Error()) // rand should never fail
}
}
// xvalues returns the value of a byte as a hexadecimal digit or 255.
var xvalues = []byte{
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 255, 255, 255, 255, 255,
255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 10, 11, 12, 13, 14, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
}
// xtob converts the the first two hex bytes of x into a byte.
func xtob(x string) (byte, bool) {
b1 := xvalues[x[0]]
b2 := xvalues[x[1]]
return (b1 << 4) | b2, b1 != 255 && b2 != 255
}

View File

@ -0,0 +1,163 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"bytes"
"crypto/rand"
"fmt"
"io"
"strings"
)
// A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC
// 4122.
type UUID []byte
// A Version represents a UUIDs version.
type Version byte
// A Variant represents a UUIDs variant.
type Variant byte
// Constants returned by Variant.
const (
Invalid = Variant(iota) // Invalid UUID
RFC4122 // The variant specified in RFC4122
Reserved // Reserved, NCS backward compatibility.
Microsoft // Reserved, Microsoft Corporation backward compatibility.
Future // Reserved for future definition.
)
var rander = rand.Reader // random function
// New returns a new random (version 4) UUID as a string. It is a convenience
// function for NewRandom().String().
func New() string {
return NewRandom().String()
}
// Parse decodes s into a UUID or returns nil. Both the UUID form of
// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded.
func Parse(s string) UUID {
if len(s) == 36+9 {
if strings.ToLower(s[:9]) != "urn:uuid:" {
return nil
}
s = s[9:]
} else if len(s) != 36 {
return nil
}
if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' {
return nil
}
uuid := make([]byte, 16)
for i, x := range []int{
0, 2, 4, 6,
9, 11,
14, 16,
19, 21,
24, 26, 28, 30, 32, 34} {
if v, ok := xtob(s[x:]); !ok {
return nil
} else {
uuid[i] = v
}
}
return uuid
}
// Equal returns true if uuid1 and uuid2 are equal.
func Equal(uuid1, uuid2 UUID) bool {
return bytes.Equal(uuid1, uuid2)
}
// String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
// , or "" if uuid is invalid.
func (uuid UUID) String() string {
if uuid == nil || len(uuid) != 16 {
return ""
}
b := []byte(uuid)
return fmt.Sprintf("%08x-%04x-%04x-%04x-%012x",
b[:4], b[4:6], b[6:8], b[8:10], b[10:])
}
// URN returns the RFC 2141 URN form of uuid,
// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid.
func (uuid UUID) URN() string {
if uuid == nil || len(uuid) != 16 {
return ""
}
b := []byte(uuid)
return fmt.Sprintf("urn:uuid:%08x-%04x-%04x-%04x-%012x",
b[:4], b[4:6], b[6:8], b[8:10], b[10:])
}
// Variant returns the variant encoded in uuid. It returns Invalid if
// uuid is invalid.
func (uuid UUID) Variant() Variant {
if len(uuid) != 16 {
return Invalid
}
switch {
case (uuid[8] & 0xc0) == 0x80:
return RFC4122
case (uuid[8] & 0xe0) == 0xc0:
return Microsoft
case (uuid[8] & 0xe0) == 0xe0:
return Future
default:
return Reserved
}
panic("unreachable")
}
// Version returns the verison of uuid. It returns false if uuid is not
// valid.
func (uuid UUID) Version() (Version, bool) {
if len(uuid) != 16 {
return 0, false
}
return Version(uuid[6] >> 4), true
}
func (v Version) String() string {
if v > 15 {
return fmt.Sprintf("BAD_VERSION_%d", v)
}
return fmt.Sprintf("VERSION_%d", v)
}
func (v Variant) String() string {
switch v {
case RFC4122:
return "RFC4122"
case Reserved:
return "Reserved"
case Microsoft:
return "Microsoft"
case Future:
return "Future"
case Invalid:
return "Invalid"
}
return fmt.Sprintf("BadVariant%d", int(v))
}
// SetRand sets the random number generator to r, which implents io.Reader.
// If r.Read returns an error when the package requests random data then
// a panic will be issued.
//
// Calling SetRand with nil sets the random number generator to the default
// generator.
func SetRand(r io.Reader) {
if r == nil {
rander = rand.Reader
return
}
rander = r
}

View File

@ -0,0 +1,390 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"bytes"
"fmt"
"os"
"strings"
"testing"
"time"
)
type test struct {
in string
version Version
variant Variant
isuuid bool
}
var tests = []test{
{"f47ac10b-58cc-0372-8567-0e02b2c3d479", 0, RFC4122, true},
{"f47ac10b-58cc-1372-8567-0e02b2c3d479", 1, RFC4122, true},
{"f47ac10b-58cc-2372-8567-0e02b2c3d479", 2, RFC4122, true},
{"f47ac10b-58cc-3372-8567-0e02b2c3d479", 3, RFC4122, true},
{"f47ac10b-58cc-4372-8567-0e02b2c3d479", 4, RFC4122, true},
{"f47ac10b-58cc-5372-8567-0e02b2c3d479", 5, RFC4122, true},
{"f47ac10b-58cc-6372-8567-0e02b2c3d479", 6, RFC4122, true},
{"f47ac10b-58cc-7372-8567-0e02b2c3d479", 7, RFC4122, true},
{"f47ac10b-58cc-8372-8567-0e02b2c3d479", 8, RFC4122, true},
{"f47ac10b-58cc-9372-8567-0e02b2c3d479", 9, RFC4122, true},
{"f47ac10b-58cc-a372-8567-0e02b2c3d479", 10, RFC4122, true},
{"f47ac10b-58cc-b372-8567-0e02b2c3d479", 11, RFC4122, true},
{"f47ac10b-58cc-c372-8567-0e02b2c3d479", 12, RFC4122, true},
{"f47ac10b-58cc-d372-8567-0e02b2c3d479", 13, RFC4122, true},
{"f47ac10b-58cc-e372-8567-0e02b2c3d479", 14, RFC4122, true},
{"f47ac10b-58cc-f372-8567-0e02b2c3d479", 15, RFC4122, true},
{"urn:uuid:f47ac10b-58cc-4372-0567-0e02b2c3d479", 4, Reserved, true},
{"URN:UUID:f47ac10b-58cc-4372-0567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-0567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-1567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-2567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-3567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-4567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-5567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-6567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-7567-0e02b2c3d479", 4, Reserved, true},
{"f47ac10b-58cc-4372-8567-0e02b2c3d479", 4, RFC4122, true},
{"f47ac10b-58cc-4372-9567-0e02b2c3d479", 4, RFC4122, true},
{"f47ac10b-58cc-4372-a567-0e02b2c3d479", 4, RFC4122, true},
{"f47ac10b-58cc-4372-b567-0e02b2c3d479", 4, RFC4122, true},
{"f47ac10b-58cc-4372-c567-0e02b2c3d479", 4, Microsoft, true},
{"f47ac10b-58cc-4372-d567-0e02b2c3d479", 4, Microsoft, true},
{"f47ac10b-58cc-4372-e567-0e02b2c3d479", 4, Future, true},
{"f47ac10b-58cc-4372-f567-0e02b2c3d479", 4, Future, true},
{"f47ac10b158cc-5372-a567-0e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc25372-a567-0e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc-53723a567-0e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc-5372-a56740e02b2c3d479", 0, Invalid, false},
{"f47ac10b-58cc-5372-a567-0e02-2c3d479", 0, Invalid, false},
{"g47ac10b-58cc-4372-a567-0e02b2c3d479", 0, Invalid, false},
}
var constants = []struct {
c interface{}
name string
}{
{Person, "Person"},
{Group, "Group"},
{Org, "Org"},
{Invalid, "Invalid"},
{RFC4122, "RFC4122"},
{Reserved, "Reserved"},
{Microsoft, "Microsoft"},
{Future, "Future"},
{Domain(17), "Domain17"},
{Variant(42), "BadVariant42"},
}
func testTest(t *testing.T, in string, tt test) {
uuid := Parse(in)
if ok := (uuid != nil); ok != tt.isuuid {
t.Errorf("Parse(%s) got %v expected %v\b", in, ok, tt.isuuid)
}
if uuid == nil {
return
}
if v := uuid.Variant(); v != tt.variant {
t.Errorf("Variant(%s) got %d expected %d\b", in, v, tt.variant)
}
if v, _ := uuid.Version(); v != tt.version {
t.Errorf("Version(%s) got %d expected %d\b", in, v, tt.version)
}
}
func TestUUID(t *testing.T) {
for _, tt := range tests {
testTest(t, tt.in, tt)
testTest(t, strings.ToUpper(tt.in), tt)
}
}
func TestConstants(t *testing.T) {
for x, tt := range constants {
v, ok := tt.c.(fmt.Stringer)
if !ok {
t.Errorf("%x: %v: not a stringer", x, v)
} else if s := v.String(); s != tt.name {
v, _ := tt.c.(int)
t.Errorf("%x: Constant %T:%d gives %q, expected %q\n", x, tt.c, v, s, tt.name)
}
}
}
func TestRandomUUID(t *testing.T) {
m := make(map[string]bool)
for x := 1; x < 32; x++ {
uuid := NewRandom()
s := uuid.String()
if m[s] {
t.Errorf("NewRandom returned duplicated UUID %s\n", s)
}
m[s] = true
if v, _ := uuid.Version(); v != 4 {
t.Errorf("Random UUID of version %s\n", v)
}
if uuid.Variant() != RFC4122 {
t.Errorf("Random UUID is variant %d\n", uuid.Variant())
}
}
}
func TestNew(t *testing.T) {
m := make(map[string]bool)
for x := 1; x < 32; x++ {
s := New()
if m[s] {
t.Errorf("New returned duplicated UUID %s\n", s)
}
m[s] = true
uuid := Parse(s)
if uuid == nil {
t.Errorf("New returned %q which does not decode\n", s)
continue
}
if v, _ := uuid.Version(); v != 4 {
t.Errorf("Random UUID of version %s\n", v)
}
if uuid.Variant() != RFC4122 {
t.Errorf("Random UUID is variant %d\n", uuid.Variant())
}
}
}
func clockSeq(t *testing.T, uuid UUID) int {
seq, ok := uuid.ClockSequence()
if !ok {
t.Fatalf("%s: invalid clock sequence\n", uuid)
}
return seq
}
func TestClockSeq(t *testing.T) {
// Fake time.Now for this test to return a monotonically advancing time; restore it at end.
defer func(orig func() time.Time) { timeNow = orig }(timeNow)
monTime := time.Now()
timeNow = func() time.Time {
monTime = monTime.Add(1 * time.Second)
return monTime
}
SetClockSequence(-1)
uuid1 := NewUUID()
uuid2 := NewUUID()
if clockSeq(t, uuid1) != clockSeq(t, uuid2) {
t.Errorf("clock sequence %d != %d\n", clockSeq(t, uuid1), clockSeq(t, uuid2))
}
SetClockSequence(-1)
uuid2 = NewUUID()
// Just on the very off chance we generated the same sequence
// two times we try again.
if clockSeq(t, uuid1) == clockSeq(t, uuid2) {
SetClockSequence(-1)
uuid2 = NewUUID()
}
if clockSeq(t, uuid1) == clockSeq(t, uuid2) {
t.Errorf("Duplicate clock sequence %d\n", clockSeq(t, uuid1))
}
SetClockSequence(0x1234)
uuid1 = NewUUID()
if seq := clockSeq(t, uuid1); seq != 0x1234 {
t.Errorf("%s: expected seq 0x1234 got 0x%04x\n", uuid1, seq)
}
}
func TestCoding(t *testing.T) {
text := "7d444840-9dc0-11d1-b245-5ffdce74fad2"
urn := "urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2"
data := UUID{
0x7d, 0x44, 0x48, 0x40,
0x9d, 0xc0,
0x11, 0xd1,
0xb2, 0x45,
0x5f, 0xfd, 0xce, 0x74, 0xfa, 0xd2,
}
if v := data.String(); v != text {
t.Errorf("%x: encoded to %s, expected %s\n", data, v, text)
}
if v := data.URN(); v != urn {
t.Errorf("%x: urn is %s, expected %s\n", data, v, urn)
}
uuid := Parse(text)
if !Equal(uuid, data) {
t.Errorf("%s: decoded to %s, expected %s\n", text, uuid, data)
}
}
func TestVersion1(t *testing.T) {
uuid1 := NewUUID()
uuid2 := NewUUID()
if Equal(uuid1, uuid2) {
t.Errorf("%s:duplicate uuid\n", uuid1)
}
if v, _ := uuid1.Version(); v != 1 {
t.Errorf("%s: version %s expected 1\n", uuid1, v)
}
if v, _ := uuid2.Version(); v != 1 {
t.Errorf("%s: version %s expected 1\n", uuid2, v)
}
n1 := uuid1.NodeID()
n2 := uuid2.NodeID()
if !bytes.Equal(n1, n2) {
t.Errorf("Different nodes %x != %x\n", n1, n2)
}
t1, ok := uuid1.Time()
if !ok {
t.Errorf("%s: invalid time\n", uuid1)
}
t2, ok := uuid2.Time()
if !ok {
t.Errorf("%s: invalid time\n", uuid2)
}
q1, ok := uuid1.ClockSequence()
if !ok {
t.Errorf("%s: invalid clock sequence\n", uuid1)
}
q2, ok := uuid2.ClockSequence()
if !ok {
t.Errorf("%s: invalid clock sequence", uuid2)
}
switch {
case t1 == t2 && q1 == q2:
t.Errorf("time stopped\n")
case t1 > t2 && q1 == q2:
t.Errorf("time reversed\n")
case t1 < t2 && q1 != q2:
t.Errorf("clock sequence chaned unexpectedly\n")
}
}
func TestNodeAndTime(t *testing.T) {
// Time is February 5, 1998 12:30:23.136364800 AM GMT
uuid := Parse("7d444840-9dc0-11d1-b245-5ffdce74fad2")
node := []byte{0x5f, 0xfd, 0xce, 0x74, 0xfa, 0xd2}
ts, ok := uuid.Time()
if ok {
c := time.Unix(ts.UnixTime())
want := time.Date(1998, 2, 5, 0, 30, 23, 136364800, time.UTC)
if !c.Equal(want) {
t.Errorf("Got time %v, want %v", c, want)
}
} else {
t.Errorf("%s: bad time\n", uuid)
}
if !bytes.Equal(node, uuid.NodeID()) {
t.Errorf("Expected node %v got %v\n", node, uuid.NodeID())
}
}
func TestMD5(t *testing.T) {
uuid := NewMD5(NameSpace_DNS, []byte("python.org")).String()
want := "6fa459ea-ee8a-3ca4-894e-db77e160355e"
if uuid != want {
t.Errorf("MD5: got %q expected %q\n", uuid, want)
}
}
func TestSHA1(t *testing.T) {
uuid := NewSHA1(NameSpace_DNS, []byte("python.org")).String()
want := "886313e1-3b8a-5372-9b90-0c9aee199e5d"
if uuid != want {
t.Errorf("SHA1: got %q expected %q\n", uuid, want)
}
}
func TestNodeID(t *testing.T) {
nid := []byte{1, 2, 3, 4, 5, 6}
SetNodeInterface("")
s := NodeInterface()
if s == "" || s == "user" {
t.Errorf("NodeInterface %q after SetInteface\n", s)
}
node1 := NodeID()
if node1 == nil {
t.Errorf("NodeID nil after SetNodeInterface\n", s)
}
SetNodeID(nid)
s = NodeInterface()
if s != "user" {
t.Errorf("Expected NodeInterface %q got %q\n", "user", s)
}
node2 := NodeID()
if node2 == nil {
t.Errorf("NodeID nil after SetNodeID\n", s)
}
if bytes.Equal(node1, node2) {
t.Errorf("NodeID not changed after SetNodeID\n", s)
} else if !bytes.Equal(nid, node2) {
t.Errorf("NodeID is %x, expected %x\n", node2, nid)
}
}
func testDCE(t *testing.T, name string, uuid UUID, domain Domain, id uint32) {
if uuid == nil {
t.Errorf("%s failed\n", name)
return
}
if v, _ := uuid.Version(); v != 2 {
t.Errorf("%s: %s: expected version 2, got %s\n", name, uuid, v)
return
}
if v, ok := uuid.Domain(); !ok || v != domain {
if !ok {
t.Errorf("%s: %d: Domain failed\n", name, uuid)
} else {
t.Errorf("%s: %s: expected domain %d, got %d\n", name, uuid, domain, v)
}
}
if v, ok := uuid.Id(); !ok || v != id {
if !ok {
t.Errorf("%s: %d: Id failed\n", name, uuid)
} else {
t.Errorf("%s: %s: expected id %d, got %d\n", name, uuid, id, v)
}
}
}
func TestDCE(t *testing.T) {
testDCE(t, "NewDCESecurity", NewDCESecurity(42, 12345678), 42, 12345678)
testDCE(t, "NewDCEPerson", NewDCEPerson(), Person, uint32(os.Getuid()))
testDCE(t, "NewDCEGroup", NewDCEGroup(), Group, uint32(os.Getgid()))
}
type badRand struct{}
func (r badRand) Read(buf []byte) (int, error) {
for i, _ := range buf {
buf[i] = byte(i)
}
return len(buf), nil
}
func TestBadRand(t *testing.T) {
SetRand(badRand{})
uuid1 := New()
uuid2 := New()
if uuid1 != uuid2 {
t.Errorf("execpted duplicates, got %q and %q\n", uuid1, uuid2)
}
SetRand(nil)
uuid1 = New()
uuid2 = New()
if uuid1 == uuid2 {
t.Errorf("unexecpted duplicates, got %q\n", uuid1)
}
}

View File

@ -0,0 +1,41 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
import (
"encoding/binary"
)
// NewUUID returns a Version 1 UUID based on the current NodeID and clock
// sequence, and the current time. If the NodeID has not been set by SetNodeID
// or SetNodeInterface then it will be set automatically. If the NodeID cannot
// be set NewUUID returns nil. If clock sequence has not been set by
// SetClockSequence then it will be set automatically. If GetTime fails to
// return the current NewUUID returns nil.
func NewUUID() UUID {
if nodeID == nil {
SetNodeInterface("")
}
now, err := GetTime()
if err != nil {
return nil
}
uuid := make([]byte, 16)
time_low := uint32(now & 0xffffffff)
time_mid := uint16((now >> 32) & 0xffff)
time_hi := uint16((now >> 48) & 0x0fff)
time_hi |= 0x1000 // Version 1
binary.BigEndian.PutUint32(uuid[0:], time_low)
binary.BigEndian.PutUint16(uuid[4:], time_mid)
binary.BigEndian.PutUint16(uuid[6:], time_hi)
binary.BigEndian.PutUint16(uuid[8:], clock_seq)
copy(uuid[10:], nodeID)
return uuid
}

View File

@ -0,0 +1,25 @@
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package uuid
// Random returns a Random (Version 4) UUID or panics.
//
// The strength of the UUIDs is based on the strength of the crypto/rand
// package.
//
// A note about uniqueness derived from from the UUID Wikipedia entry:
//
// Randomly generated UUIDs have 122 random bits. One's annual risk of being
// hit by a meteorite is estimated to be one chance in 17 billion, that
// means the probability is about 0.00000000006 (6 × 1011),
// equivalent to the odds of creating a few tens of trillions of UUIDs in a
// year and having one duplicate.
func NewRandom() UUID {
uuid := make([]byte, 16)
randomBits([]byte(uuid))
uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4
uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10
return uuid
}

View File

@ -0,0 +1,124 @@
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package snappy
import (
"encoding/binary"
"errors"
)
// ErrCorrupt reports that the input is invalid.
var ErrCorrupt = errors.New("snappy: corrupt input")
// DecodedLen returns the length of the decoded block.
func DecodedLen(src []byte) (int, error) {
v, _, err := decodedLen(src)
return v, err
}
// decodedLen returns the length of the decoded block and the number of bytes
// that the length header occupied.
func decodedLen(src []byte) (blockLen, headerLen int, err error) {
v, n := binary.Uvarint(src)
if n == 0 {
return 0, 0, ErrCorrupt
}
if uint64(int(v)) != v {
return 0, 0, errors.New("snappy: decoded block is too large")
}
return int(v), n, nil
}
// Decode returns the decoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire decoded block.
// Otherwise, a newly allocated slice will be returned.
// It is valid to pass a nil dst.
func Decode(dst, src []byte) ([]byte, error) {
dLen, s, err := decodedLen(src)
if err != nil {
return nil, err
}
if len(dst) < dLen {
dst = make([]byte, dLen)
}
var d, offset, length int
for s < len(src) {
switch src[s] & 0x03 {
case tagLiteral:
x := uint(src[s] >> 2)
switch {
case x < 60:
s += 1
case x == 60:
s += 2
if s > len(src) {
return nil, ErrCorrupt
}
x = uint(src[s-1])
case x == 61:
s += 3
if s > len(src) {
return nil, ErrCorrupt
}
x = uint(src[s-2]) | uint(src[s-1])<<8
case x == 62:
s += 4
if s > len(src) {
return nil, ErrCorrupt
}
x = uint(src[s-3]) | uint(src[s-2])<<8 | uint(src[s-1])<<16
case x == 63:
s += 5
if s > len(src) {
return nil, ErrCorrupt
}
x = uint(src[s-4]) | uint(src[s-3])<<8 | uint(src[s-2])<<16 | uint(src[s-1])<<24
}
length = int(x + 1)
if length <= 0 {
return nil, errors.New("snappy: unsupported literal length")
}
if length > len(dst)-d || length > len(src)-s {
return nil, ErrCorrupt
}
copy(dst[d:], src[s:s+length])
d += length
s += length
continue
case tagCopy1:
s += 2
if s > len(src) {
return nil, ErrCorrupt
}
length = 4 + int(src[s-2])>>2&0x7
offset = int(src[s-2])&0xe0<<3 | int(src[s-1])
case tagCopy2:
s += 3
if s > len(src) {
return nil, ErrCorrupt
}
length = 1 + int(src[s-3])>>2
offset = int(src[s-2]) | int(src[s-1])<<8
case tagCopy4:
return nil, errors.New("snappy: unsupported COPY_4 tag")
}
end := d + length
if offset > d || end > len(dst) {
return nil, ErrCorrupt
}
for ; d < end; d++ {
dst[d] = dst[d-offset]
}
}
if d != dLen {
return nil, ErrCorrupt
}
return dst[:d], nil
}

View File

@ -0,0 +1,174 @@
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package snappy
import (
"encoding/binary"
)
// We limit how far copy back-references can go, the same as the C++ code.
const maxOffset = 1 << 15
// emitLiteral writes a literal chunk and returns the number of bytes written.
func emitLiteral(dst, lit []byte) int {
i, n := 0, uint(len(lit)-1)
switch {
case n < 60:
dst[0] = uint8(n)<<2 | tagLiteral
i = 1
case n < 1<<8:
dst[0] = 60<<2 | tagLiteral
dst[1] = uint8(n)
i = 2
case n < 1<<16:
dst[0] = 61<<2 | tagLiteral
dst[1] = uint8(n)
dst[2] = uint8(n >> 8)
i = 3
case n < 1<<24:
dst[0] = 62<<2 | tagLiteral
dst[1] = uint8(n)
dst[2] = uint8(n >> 8)
dst[3] = uint8(n >> 16)
i = 4
case int64(n) < 1<<32:
dst[0] = 63<<2 | tagLiteral
dst[1] = uint8(n)
dst[2] = uint8(n >> 8)
dst[3] = uint8(n >> 16)
dst[4] = uint8(n >> 24)
i = 5
default:
panic("snappy: source buffer is too long")
}
if copy(dst[i:], lit) != len(lit) {
panic("snappy: destination buffer is too short")
}
return i + len(lit)
}
// emitCopy writes a copy chunk and returns the number of bytes written.
func emitCopy(dst []byte, offset, length int) int {
i := 0
for length > 0 {
x := length - 4
if 0 <= x && x < 1<<3 && offset < 1<<11 {
dst[i+0] = uint8(offset>>8)&0x07<<5 | uint8(x)<<2 | tagCopy1
dst[i+1] = uint8(offset)
i += 2
break
}
x = length
if x > 1<<6 {
x = 1 << 6
}
dst[i+0] = uint8(x-1)<<2 | tagCopy2
dst[i+1] = uint8(offset)
dst[i+2] = uint8(offset >> 8)
i += 3
length -= x
}
return i
}
// Encode returns the encoded form of src. The returned slice may be a sub-
// slice of dst if dst was large enough to hold the entire encoded block.
// Otherwise, a newly allocated slice will be returned.
// It is valid to pass a nil dst.
func Encode(dst, src []byte) ([]byte, error) {
if n := MaxEncodedLen(len(src)); len(dst) < n {
dst = make([]byte, n)
}
// The block starts with the varint-encoded length of the decompressed bytes.
d := binary.PutUvarint(dst, uint64(len(src)))
// Return early if src is short.
if len(src) <= 4 {
if len(src) != 0 {
d += emitLiteral(dst[d:], src)
}
return dst[:d], nil
}
// Initialize the hash table. Its size ranges from 1<<8 to 1<<14 inclusive.
const maxTableSize = 1 << 14
shift, tableSize := uint(32-8), 1<<8
for tableSize < maxTableSize && tableSize < len(src) {
shift--
tableSize *= 2
}
var table [maxTableSize]int
// Iterate over the source bytes.
var (
s int // The iterator position.
t int // The last position with the same hash as s.
lit int // The start position of any pending literal bytes.
)
for s+3 < len(src) {
// Update the hash table.
b0, b1, b2, b3 := src[s], src[s+1], src[s+2], src[s+3]
h := uint32(b0) | uint32(b1)<<8 | uint32(b2)<<16 | uint32(b3)<<24
p := &table[(h*0x1e35a7bd)>>shift]
// We need to to store values in [-1, inf) in table. To save
// some initialization time, (re)use the table's zero value
// and shift the values against this zero: add 1 on writes,
// subtract 1 on reads.
t, *p = *p-1, s+1
// If t is invalid or src[s:s+4] differs from src[t:t+4], accumulate a literal byte.
if t < 0 || s-t >= maxOffset || b0 != src[t] || b1 != src[t+1] || b2 != src[t+2] || b3 != src[t+3] {
s++
continue
}
// Otherwise, we have a match. First, emit any pending literal bytes.
if lit != s {
d += emitLiteral(dst[d:], src[lit:s])
}
// Extend the match to be as long as possible.
s0 := s
s, t = s+4, t+4
for s < len(src) && src[s] == src[t] {
s++
t++
}
// Emit the copied bytes.
d += emitCopy(dst[d:], s-t, s-s0)
lit = s
}
// Emit any final pending literal bytes and return.
if lit != len(src) {
d += emitLiteral(dst[d:], src[lit:])
}
return dst[:d], nil
}
// MaxEncodedLen returns the maximum length of a snappy block, given its
// uncompressed length.
func MaxEncodedLen(srcLen int) int {
// Compressed data can be defined as:
// compressed := item* literal*
// item := literal* copy
//
// The trailing literal sequence has a space blowup of at most 62/60
// since a literal of length 60 needs one tag byte + one extra byte
// for length information.
//
// Item blowup is trickier to measure. Suppose the "copy" op copies
// 4 bytes of data. Because of a special check in the encoding code,
// we produce a 4-byte copy only if the offset is < 65536. Therefore
// the copy op takes 3 bytes to encode, and this type of item leads
// to at most the 62/60 blowup for representing literals.
//
// Suppose the "copy" op copies 5 bytes of data. If the offset is big
// enough, it will take 5 bytes to encode the copy op. Therefore the
// worst case here is a one-byte literal followed by a five-byte copy.
// That is, 6 bytes of input turn into 7 bytes of "compressed" data.
//
// This last factor dominates the blowup, so the final estimate is:
return 32 + srcLen + srcLen/6
}

View File

@ -0,0 +1,38 @@
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package snappy implements the snappy block-based compression format.
// It aims for very high speeds and reasonable compression.
//
// The C++ snappy implementation is at http://code.google.com/p/snappy/
package snappy
/*
Each encoded block begins with the varint-encoded length of the decoded data,
followed by a sequence of chunks. Chunks begin and end on byte boundaries. The
first byte of each chunk is broken into its 2 least and 6 most significant bits
called l and m: l ranges in [0, 4) and m ranges in [0, 64). l is the chunk tag.
Zero means a literal tag. All other values mean a copy tag.
For literal tags:
- If m < 60, the next 1 + m bytes are literal bytes.
- Otherwise, let n be the little-endian unsigned integer denoted by the next
m - 59 bytes. The next 1 + n bytes after that are literal bytes.
For copy tags, length bytes are copied from offset bytes ago, in the style of
Lempel-Ziv compression algorithms. In particular:
- For l == 1, the offset ranges in [0, 1<<11) and the length in [4, 12).
The length is 4 + the low 3 bits of m. The high 3 bits of m form bits 8-10
of the offset. The next byte is bits 0-7 of the offset.
- For l == 2, the offset ranges in [0, 1<<16) and the length in [1, 65).
The length is 1 + m. The offset is the little-endian unsigned integer
denoted by the next 2 bytes.
- For l == 3, this tag is a legacy format that is no longer supported.
*/
const (
tagLiteral = 0x00
tagCopy1 = 0x01
tagCopy2 = 0x02
tagCopy4 = 0x03
)

View File

@ -0,0 +1,261 @@
// Copyright 2011 The Snappy-Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package snappy
import (
"bytes"
"flag"
"fmt"
"io"
"io/ioutil"
"math/rand"
"net/http"
"os"
"path/filepath"
"strings"
"testing"
)
var download = flag.Bool("download", false, "If true, download any missing files before running benchmarks")
func roundtrip(b, ebuf, dbuf []byte) error {
e, err := Encode(ebuf, b)
if err != nil {
return fmt.Errorf("encoding error: %v", err)
}
d, err := Decode(dbuf, e)
if err != nil {
return fmt.Errorf("decoding error: %v", err)
}
if !bytes.Equal(b, d) {
return fmt.Errorf("roundtrip mismatch:\n\twant %v\n\tgot %v", b, d)
}
return nil
}
func TestEmpty(t *testing.T) {
if err := roundtrip(nil, nil, nil); err != nil {
t.Fatal(err)
}
}
func TestSmallCopy(t *testing.T) {
for _, ebuf := range [][]byte{nil, make([]byte, 20), make([]byte, 64)} {
for _, dbuf := range [][]byte{nil, make([]byte, 20), make([]byte, 64)} {
for i := 0; i < 32; i++ {
s := "aaaa" + strings.Repeat("b", i) + "aaaabbbb"
if err := roundtrip([]byte(s), ebuf, dbuf); err != nil {
t.Errorf("len(ebuf)=%d, len(dbuf)=%d, i=%d: %v", len(ebuf), len(dbuf), i, err)
}
}
}
}
}
func TestSmallRand(t *testing.T) {
rand.Seed(27354294)
for n := 1; n < 20000; n += 23 {
b := make([]byte, n)
for i, _ := range b {
b[i] = uint8(rand.Uint32())
}
if err := roundtrip(b, nil, nil); err != nil {
t.Fatal(err)
}
}
}
func TestSmallRegular(t *testing.T) {
for n := 1; n < 20000; n += 23 {
b := make([]byte, n)
for i, _ := range b {
b[i] = uint8(i%10 + 'a')
}
if err := roundtrip(b, nil, nil); err != nil {
t.Fatal(err)
}
}
}
func benchDecode(b *testing.B, src []byte) {
encoded, err := Encode(nil, src)
if err != nil {
b.Fatal(err)
}
// Bandwidth is in amount of uncompressed data.
b.SetBytes(int64(len(src)))
b.ResetTimer()
for i := 0; i < b.N; i++ {
Decode(src, encoded)
}
}
func benchEncode(b *testing.B, src []byte) {
// Bandwidth is in amount of uncompressed data.
b.SetBytes(int64(len(src)))
dst := make([]byte, MaxEncodedLen(len(src)))
b.ResetTimer()
for i := 0; i < b.N; i++ {
Encode(dst, src)
}
}
func readFile(b *testing.B, filename string) []byte {
src, err := ioutil.ReadFile(filename)
if err != nil {
b.Fatalf("failed reading %s: %s", filename, err)
}
if len(src) == 0 {
b.Fatalf("%s has zero length", filename)
}
return src
}
// expand returns a slice of length n containing repeated copies of src.
func expand(src []byte, n int) []byte {
dst := make([]byte, n)
for x := dst; len(x) > 0; {
i := copy(x, src)
x = x[i:]
}
return dst
}
func benchWords(b *testing.B, n int, decode bool) {
// Note: the file is OS-language dependent so the resulting values are not
// directly comparable for non-US-English OS installations.
data := expand(readFile(b, "/usr/share/dict/words"), n)
if decode {
benchDecode(b, data)
} else {
benchEncode(b, data)
}
}
func BenchmarkWordsDecode1e3(b *testing.B) { benchWords(b, 1e3, true) }
func BenchmarkWordsDecode1e4(b *testing.B) { benchWords(b, 1e4, true) }
func BenchmarkWordsDecode1e5(b *testing.B) { benchWords(b, 1e5, true) }
func BenchmarkWordsDecode1e6(b *testing.B) { benchWords(b, 1e6, true) }
func BenchmarkWordsEncode1e3(b *testing.B) { benchWords(b, 1e3, false) }
func BenchmarkWordsEncode1e4(b *testing.B) { benchWords(b, 1e4, false) }
func BenchmarkWordsEncode1e5(b *testing.B) { benchWords(b, 1e5, false) }
func BenchmarkWordsEncode1e6(b *testing.B) { benchWords(b, 1e6, false) }
// testFiles' values are copied directly from
// https://code.google.com/p/snappy/source/browse/trunk/snappy_unittest.cc.
// The label field is unused in snappy-go.
var testFiles = []struct {
label string
filename string
}{
{"html", "html"},
{"urls", "urls.10K"},
{"jpg", "house.jpg"},
{"pdf", "mapreduce-osdi-1.pdf"},
{"html4", "html_x_4"},
{"cp", "cp.html"},
{"c", "fields.c"},
{"lsp", "grammar.lsp"},
{"xls", "kennedy.xls"},
{"txt1", "alice29.txt"},
{"txt2", "asyoulik.txt"},
{"txt3", "lcet10.txt"},
{"txt4", "plrabn12.txt"},
{"bin", "ptt5"},
{"sum", "sum"},
{"man", "xargs.1"},
{"pb", "geo.protodata"},
{"gaviota", "kppkn.gtb"},
}
// The test data files are present at this canonical URL.
const baseURL = "https://snappy.googlecode.com/svn/trunk/testdata/"
func downloadTestdata(basename string) (errRet error) {
filename := filepath.Join("testdata", basename)
f, err := os.Create(filename)
if err != nil {
return fmt.Errorf("failed to create %s: %s", filename, err)
}
defer f.Close()
defer func() {
if errRet != nil {
os.Remove(filename)
}
}()
resp, err := http.Get(baseURL + basename)
if err != nil {
return fmt.Errorf("failed to download %s: %s", baseURL+basename, err)
}
defer resp.Body.Close()
_, err = io.Copy(f, resp.Body)
if err != nil {
return fmt.Errorf("failed to write %s: %s", filename, err)
}
return nil
}
func benchFile(b *testing.B, n int, decode bool) {
filename := filepath.Join("testdata", testFiles[n].filename)
if stat, err := os.Stat(filename); err != nil || stat.Size() == 0 {
if !*download {
b.Fatal("test data not found; skipping benchmark without the -download flag")
}
// Download the official snappy C++ implementation reference test data
// files for benchmarking.
if err := os.Mkdir("testdata", 0777); err != nil && !os.IsExist(err) {
b.Fatalf("failed to create testdata: %s", err)
}
for _, tf := range testFiles {
if err := downloadTestdata(tf.filename); err != nil {
b.Fatalf("failed to download testdata: %s", err)
}
}
}
data := readFile(b, filename)
if decode {
benchDecode(b, data)
} else {
benchEncode(b, data)
}
}
// Naming convention is kept similar to what snappy's C++ implementation uses.
func Benchmark_UFlat0(b *testing.B) { benchFile(b, 0, true) }
func Benchmark_UFlat1(b *testing.B) { benchFile(b, 1, true) }
func Benchmark_UFlat2(b *testing.B) { benchFile(b, 2, true) }
func Benchmark_UFlat3(b *testing.B) { benchFile(b, 3, true) }
func Benchmark_UFlat4(b *testing.B) { benchFile(b, 4, true) }
func Benchmark_UFlat5(b *testing.B) { benchFile(b, 5, true) }
func Benchmark_UFlat6(b *testing.B) { benchFile(b, 6, true) }
func Benchmark_UFlat7(b *testing.B) { benchFile(b, 7, true) }
func Benchmark_UFlat8(b *testing.B) { benchFile(b, 8, true) }
func Benchmark_UFlat9(b *testing.B) { benchFile(b, 9, true) }
func Benchmark_UFlat10(b *testing.B) { benchFile(b, 10, true) }
func Benchmark_UFlat11(b *testing.B) { benchFile(b, 11, true) }
func Benchmark_UFlat12(b *testing.B) { benchFile(b, 12, true) }
func Benchmark_UFlat13(b *testing.B) { benchFile(b, 13, true) }
func Benchmark_UFlat14(b *testing.B) { benchFile(b, 14, true) }
func Benchmark_UFlat15(b *testing.B) { benchFile(b, 15, true) }
func Benchmark_UFlat16(b *testing.B) { benchFile(b, 16, true) }
func Benchmark_UFlat17(b *testing.B) { benchFile(b, 17, true) }
func Benchmark_ZFlat0(b *testing.B) { benchFile(b, 0, false) }
func Benchmark_ZFlat1(b *testing.B) { benchFile(b, 1, false) }
func Benchmark_ZFlat2(b *testing.B) { benchFile(b, 2, false) }
func Benchmark_ZFlat3(b *testing.B) { benchFile(b, 3, false) }
func Benchmark_ZFlat4(b *testing.B) { benchFile(b, 4, false) }
func Benchmark_ZFlat5(b *testing.B) { benchFile(b, 5, false) }
func Benchmark_ZFlat6(b *testing.B) { benchFile(b, 6, false) }
func Benchmark_ZFlat7(b *testing.B) { benchFile(b, 7, false) }
func Benchmark_ZFlat8(b *testing.B) { benchFile(b, 8, false) }
func Benchmark_ZFlat9(b *testing.B) { benchFile(b, 9, false) }
func Benchmark_ZFlat10(b *testing.B) { benchFile(b, 10, false) }
func Benchmark_ZFlat11(b *testing.B) { benchFile(b, 11, false) }
func Benchmark_ZFlat12(b *testing.B) { benchFile(b, 12, false) }
func Benchmark_ZFlat13(b *testing.B) { benchFile(b, 13, false) }
func Benchmark_ZFlat14(b *testing.B) { benchFile(b, 14, false) }
func Benchmark_ZFlat15(b *testing.B) { benchFile(b, 15, false) }
func Benchmark_ZFlat16(b *testing.B) { benchFile(b, 16, false) }
func Benchmark_ZFlat17(b *testing.B) { benchFile(b, 17, false) }

View File

@ -0,0 +1,5 @@
/tmp
*/**/*un~
*un~
.DS_Store
*/**/.DS_Store

View File

@ -0,0 +1,3 @@
[submodule "serp"]
path = serpent
url = https://github.com/ethereum/serpent.git

View File

@ -0,0 +1,12 @@
[serpent](https://github.com/ethereum/serpent) go bindings.
## Build instructions
```
go get -d github.com/ethereum/serpent-go
cd $GOPATH/src/github.com/ethereum/serpent-go
git submodule init
git submodule update
```
You're now ready to go :-)

View File

@ -0,0 +1,16 @@
#include "serpent/bignum.cpp"
#include "serpent/util.cpp"
#include "serpent/tokenize.cpp"
#include "serpent/parser.cpp"
#include "serpent/compiler.cpp"
#include "serpent/funcs.cpp"
#include "serpent/lllparser.cpp"
#include "serpent/rewriter.cpp"
#include "serpent/opcodes.cpp"
#include "serpent/optimize.cpp"
#include "serpent/functions.cpp"
#include "serpent/preprocess.cpp"
#include "serpent/rewriteutils.cpp"
#include "cpp/api.cpp"

View File

@ -0,0 +1,26 @@
#include <string>
#include "serpent/lllparser.h"
#include "serpent/bignum.h"
#include "serpent/util.h"
#include "serpent/tokenize.h"
#include "serpent/parser.h"
#include "serpent/compiler.h"
#include "cpp/api.h"
const char *compileGo(char *code, int *err)
{
try {
std::string c = binToHex(compile(std::string(code)));
return c.c_str();
}
catch(std::string &error) {
*err = 1;
return error.c_str();
}
catch(...) {
return "Unknown error";
}
}

View File

@ -0,0 +1,14 @@
#ifndef CPP_API_H
#define CPP_API_H
#ifdef __cplusplus
extern "C" {
#endif
const char *compileGo(char *code, int *err);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,27 @@
package serpent
// #cgo CXXFLAGS: -I. -Ilangs/ -std=c++0x -Wall -fno-strict-aliasing
// #cgo LDFLAGS: -lstdc++
//
// #include "cpp/api.h"
//
import "C"
import (
"encoding/hex"
"errors"
"unsafe"
)
func Compile(str string) ([]byte, error) {
var err C.int
out := C.GoString(C.compileGo(C.CString(str), (*C.int)(unsafe.Pointer(&err))))
if err == C.int(1) {
return nil, errors.New(out)
}
bytes, _ := hex.DecodeString(out)
return bytes, nil
}

View File

@ -0,0 +1,12 @@
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
*.o
serpent
libserpent.a
pyserpent.so
dist
*.egg-info

View File

@ -0,0 +1,5 @@
include *.cpp
include *.h
include *py
include README.md
include Makefile

View File

@ -0,0 +1,55 @@
PLATFORM_OPTS =
PYTHON = /usr/include/python2.7
CXXFLAGS = -fPIC
# -g3 -O0
BOOST_INC = /usr/include
BOOST_LIB = /usr/lib
TARGET = pyserpent
COMMON_OBJS = bignum.o util.o tokenize.o lllparser.o parser.o opcodes.o optimize.o functions.o rewriteutils.o preprocess.o rewriter.o compiler.o funcs.o
HEADERS = bignum.h util.h tokenize.h lllparser.h parser.h opcodes.h functions.h optimize.h rewriteutils.h preprocess.h rewriter.h compiler.h funcs.h
PYTHON_VERSION = 2.7
serpent : serpentc lib
lib:
ar rvs libserpent.a $(COMMON_OBJS)
g++ $(CXXFLAGS) -shared $(COMMON_OBJS) -o libserpent.so
serpentc: $(COMMON_OBJS) cmdline.o
rm -rf serpent
g++ -Wall $(COMMON_OBJS) cmdline.o -o serpent
bignum.o : bignum.cpp bignum.h
opcodes.o : opcodes.cpp opcodes.h
util.o : util.cpp util.h bignum.o
tokenize.o : tokenize.cpp tokenize.h util.o
lllparser.o : lllparser.cpp lllparser.h tokenize.o util.o
parser.o : parser.cpp parser.h tokenize.o util.o
rewriter.o : rewriter.cpp rewriter.h lllparser.o util.o rewriteutils.o preprocess.o opcodes.o functions.o
preprocessor.o: rewriteutils.o functions.o
compiler.o : compiler.cpp compiler.h util.o
funcs.o : funcs.cpp funcs.h
cmdline.o: cmdline.cpp
pyext.o: pyext.cpp
clean:
rm -f serpent *\.o libserpent.a libserpent.so
install:
cp serpent /usr/local/bin
cp libserpent.a /usr/local/lib
cp libserpent.so /usr/local/lib
rm -rf /usr/local/include/libserpent
mkdir -p /usr/local/include/libserpent
cp $(HEADERS) /usr/local/include/libserpent

View File

@ -0,0 +1,3 @@
Installation:
```make && sudo make install```

View File

@ -0,0 +1,112 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "bignum.h"
//Integer to string conversion
std::string unsignedToDecimal(unsigned branch) {
if (branch < 10) return nums.substr(branch, 1);
else return unsignedToDecimal(branch / 10) + nums.substr(branch % 10,1);
}
//Add two strings representing decimal values
std::string decimalAdd(std::string a, std::string b) {
std::string o = a;
while (b.length() < a.length()) b = "0" + b;
while (o.length() < b.length()) o = "0" + o;
bool carry = false;
for (int i = o.length() - 1; i >= 0; i--) {
o[i] = o[i] + b[i] - '0';
if (carry) o[i]++;
if (o[i] > '9') {
o[i] -= 10;
carry = true;
}
else carry = false;
}
if (carry) o = "1" + o;
return o;
}
//Helper function for decimalMul
std::string decimalDigitMul(std::string a, int dig) {
if (dig == 0) return "0";
else return decimalAdd(a, decimalDigitMul(a, dig - 1));
}
//Multiply two strings representing decimal values
std::string decimalMul(std::string a, std::string b) {
std::string o = "0";
for (unsigned i = 0; i < b.length(); i++) {
std::string n = decimalDigitMul(a, b[i] - '0');
if (n != "0") {
for (unsigned j = i + 1; j < b.length(); j++) n += "0";
}
o = decimalAdd(o, n);
}
return o;
}
//Modexp
std::string decimalModExp(std::string b, std::string e, std::string m) {
if (e == "0") return "1";
else if (e == "1") return b;
else if (decimalMod(e, "2") == "0") {
std::string o = decimalModExp(b, decimalDiv(e, "2"), m);
return decimalMod(decimalMul(o, o), m);
}
else {
std::string o = decimalModExp(b, decimalDiv(e, "2"), m);
return decimalMod(decimalMul(decimalMul(o, o), b), m);
}
}
//Is a greater than b? Flag allows equality
bool decimalGt(std::string a, std::string b, bool eqAllowed) {
if (a == b) return eqAllowed;
return (a.length() > b.length()) || (a.length() >= b.length() && a > b);
}
//Subtract the two strings representing decimal values
std::string decimalSub(std::string a, std::string b) {
if (b == "0") return a;
if (b == a) return "0";
while (b.length() < a.length()) b = "0" + b;
std::string c = b;
for (unsigned i = 0; i < c.length(); i++) c[i] = '0' + ('9' - c[i]);
std::string o = decimalAdd(decimalAdd(a, c).substr(1), "1");
while (o.size() > 1 && o[0] == '0') o = o.substr(1);
return o;
}
//Divide the two strings representing decimal values
std::string decimalDiv(std::string a, std::string b) {
std::string c = b;
if (decimalGt(c, a)) return "0";
int zeroes = -1;
while (decimalGt(a, c, true)) {
zeroes += 1;
c = c + "0";
}
c = c.substr(0, c.size() - 1);
std::string quot = "0";
while (decimalGt(a, c, true)) {
a = decimalSub(a, c);
quot = decimalAdd(quot, "1");
}
for (int i = 0; i < zeroes; i++) quot += "0";
return decimalAdd(quot, decimalDiv(a, b));
}
//Modulo the two strings representing decimal values
std::string decimalMod(std::string a, std::string b) {
return decimalSub(a, decimalMul(decimalDiv(a, b), b));
}
//String to int conversion
unsigned decimalToUnsigned(std::string a) {
if (a.size() == 0) return 0;
else return (a[a.size() - 1] - '0')
+ decimalToUnsigned(a.substr(0,a.size()-1)) * 10;
}

View File

@ -0,0 +1,41 @@
#ifndef ETHSERP_BIGNUM
#define ETHSERP_BIGNUM
const std::string nums = "0123456789";
const std::string tt256 =
"115792089237316195423570985008687907853269984665640564039457584007913129639936"
;
const std::string tt256m1 =
"115792089237316195423570985008687907853269984665640564039457584007913129639935"
;
const std::string tt255 =
"57896044618658097711785492504343953926634992332820282019728792003956564819968";
const std::string tt176 =
"95780971304118053647396689196894323976171195136475136";
std::string unsignedToDecimal(unsigned branch);
std::string decimalAdd(std::string a, std::string b);
std::string decimalMul(std::string a, std::string b);
std::string decimalSub(std::string a, std::string b);
std::string decimalDiv(std::string a, std::string b);
std::string decimalMod(std::string a, std::string b);
std::string decimalModExp(std::string b, std::string e, std::string m);
bool decimalGt(std::string a, std::string b, bool eqAllowed=false);
unsigned decimalToUnsigned(std::string a);
#define utd unsignedToDecimal
#define dtu decimalToUnsigned
#endif

View File

@ -0,0 +1,132 @@
#include <stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include "funcs.h"
int main(int argv, char** argc) {
if (argv == 1) {
std::cerr << "Must provide a command and arguments! Try parse, rewrite, compile, assemble\n";
return 0;
}
if (argv == 2 && std::string(argc[1]) == "--help" || std::string(argc[1]) == "-h" ) {
std::cout << argc[1] << "\n";
std::cout << "serpent command input\n";
std::cout << "where input -s for from stdin, a file, or interpreted as serpent code if does not exist as file.";
std::cout << "where command: \n";
std::cout << " parse: Just parses and returns s-expression code.\n";
std::cout << " rewrite: Parse, use rewrite rules print s-expressions of result.\n";
std::cout << " compile: Return resulting compiled EVM code in hex.\n";
std::cout << " assemble: Return result from step before compilation.\n";
return 0;
}
std::string flag = "";
std::string command = argc[1];
std::string input;
std::string secondInput;
if (std::string(argc[1]) == "-s") {
flag = command.substr(1);
command = argc[2];
input = "";
std::string line;
while (std::getline(std::cin, line)) {
input += line + "\n";
}
secondInput = argv == 3 ? "" : argc[3];
}
else {
if (argv == 2) {
std::cerr << "Not enough arguments for serpent cmdline\n";
throw(0);
}
input = argc[2];
secondInput = argv == 3 ? "" : argc[3];
}
bool haveSec = secondInput.length() > 0;
if (command == "parse" || command == "parse_serpent") {
std::cout << printAST(parseSerpent(input), haveSec) << "\n";
}
else if (command == "rewrite") {
std::cout << printAST(rewrite(parseLLL(input, true)), haveSec) << "\n";
}
else if (command == "compile_to_lll") {
std::cout << printAST(compileToLLL(input), haveSec) << "\n";
}
else if (command == "rewrite_chunk") {
std::cout << printAST(rewriteChunk(parseLLL(input, true)), haveSec) << "\n";
}
else if (command == "compile_chunk_to_lll") {
std::cout << printAST(compileChunkToLLL(input), haveSec) << "\n";
}
else if (command == "build_fragtree") {
std::cout << printAST(buildFragmentTree(parseLLL(input, true))) << "\n";
}
else if (command == "compile_lll") {
std::cout << binToHex(compileLLL(parseLLL(input, true))) << "\n";
}
else if (command == "dereference") {
std::cout << printAST(dereference(parseLLL(input, true)), haveSec) <<"\n";
}
else if (command == "pretty_assemble") {
std::cout << printTokens(prettyAssemble(parseLLL(input, true))) <<"\n";
}
else if (command == "pretty_compile_lll") {
std::cout << printTokens(prettyCompileLLL(parseLLL(input, true))) << "\n";
}
else if (command == "pretty_compile") {
std::cout << printTokens(prettyCompile(input)) << "\n";
}
else if (command == "pretty_compile_chunk") {
std::cout << printTokens(prettyCompileChunk(input)) << "\n";
}
else if (command == "assemble") {
std::cout << assemble(parseLLL(input, true)) << "\n";
}
else if (command == "serialize") {
std::cout << binToHex(serialize(tokenize(input, Metadata(), false))) << "\n";
}
else if (command == "flatten") {
std::cout << printTokens(flatten(parseLLL(input, true))) << "\n";
}
else if (command == "deserialize") {
std::cout << printTokens(deserialize(hexToBin(input))) << "\n";
}
else if (command == "compile") {
std::cout << binToHex(compile(input)) << "\n";
}
else if (command == "compile_chunk") {
std::cout << binToHex(compileChunk(input)) << "\n";
}
else if (command == "encode_datalist") {
std::vector<Node> tokens = tokenize(input);
std::vector<std::string> o;
for (int i = 0; i < (int)tokens.size(); i++) {
o.push_back(tokens[i].val);
}
std::cout << binToHex(encodeDatalist(o)) << "\n";
}
else if (command == "decode_datalist") {
std::vector<std::string> o = decodeDatalist(hexToBin(input));
std::vector<Node> tokens;
for (int i = 0; i < (int)o.size(); i++)
tokens.push_back(token(o[i]));
std::cout << printTokens(tokens) << "\n";
}
else if (command == "tokenize") {
std::cout << printTokens(tokenize(input));
}
else if (command == "biject") {
if (argv == 3)
std::cerr << "Not enough arguments for biject\n";
int pos = decimalToUnsigned(secondInput);
std::vector<Node> n = prettyCompile(input);
if (pos >= (int)n.size())
std::cerr << "Code position too high\n";
Metadata m = n[pos].metadata;
std::cout << "Opcode: " << n[pos].val << ", file: " << m.file <<
", line: " << m.ln << ", char: " << m.ch << "\n";
}
}

View File

@ -0,0 +1,554 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "bignum.h"
#include "opcodes.h"
struct programAux {
std::map<std::string, std::string> vars;
int nextVarMem;
bool allocUsed;
bool calldataUsed;
int step;
int labelLength;
};
struct programVerticalAux {
int height;
std::string innerScopeName;
std::map<std::string, int> dupvars;
std::map<std::string, int> funvars;
std::vector<mss> scopes;
};
struct programData {
programAux aux;
Node code;
int outs;
};
programAux Aux() {
programAux o;
o.allocUsed = false;
o.calldataUsed = false;
o.step = 0;
o.nextVarMem = 32;
return o;
}
programVerticalAux verticalAux() {
programVerticalAux o;
o.height = 0;
o.dupvars = std::map<std::string, int>();
o.funvars = std::map<std::string, int>();
o.scopes = std::vector<mss>();
return o;
}
programData pd(programAux aux = Aux(), Node code=token("_"), int outs=0) {
programData o;
o.aux = aux;
o.code = code;
o.outs = outs;
return o;
}
Node multiToken(Node nodes[], int len, Metadata met) {
std::vector<Node> out;
for (int i = 0; i < len; i++) {
out.push_back(nodes[i]);
}
return astnode("_", out, met);
}
Node finalize(programData c);
Node popwrap(Node node) {
Node nodelist[] = {
node,
token("POP", node.metadata)
};
return multiToken(nodelist, 2, node.metadata);
}
// Grabs variables
mss getVariables(Node node, mss cur=mss()) {
Metadata m = node.metadata;
// Tokens don't contain any variables
if (node.type == TOKEN)
return cur;
// Don't descend into call fragments
else if (node.val == "lll")
return getVariables(node.args[1], cur);
// At global scope get/set/ref also declare
else if (node.val == "get" || node.val == "set" || node.val == "ref") {
if (node.args[0].type != TOKEN)
err("Variable name must be simple token,"
" not complex expression!", m);
if (!cur.count(node.args[0].val)) {
cur[node.args[0].val] = utd(cur.size() * 32 + 32);
//std::cerr << node.args[0].val << " " << cur[node.args[0].val] << "\n";
}
}
// Recursively process children
for (unsigned i = 0; i < node.args.size(); i++) {
cur = getVariables(node.args[i], cur);
}
return cur;
}
// Turns LLL tree into tree of code fragments
programData opcodeify(Node node,
programAux aux=Aux(),
programVerticalAux vaux=verticalAux()) {
std::string symb = "_"+mkUniqueToken();
Metadata m = node.metadata;
// Get variables
if (!aux.vars.size()) {
aux.vars = getVariables(node);
aux.nextVarMem = aux.vars.size() * 32 + 32;
}
// Numbers
if (node.type == TOKEN) {
return pd(aux, nodeToNumeric(node), 1);
}
else if (node.val == "ref" || node.val == "get" || node.val == "set") {
std::string varname = node.args[0].val;
// Determine reference to variable
Node varNode = tkn(aux.vars[varname], m);
//std::cerr << varname << " " << printSimple(varNode) << "\n";
// Set variable
if (node.val == "set") {
programData sub = opcodeify(node.args[1], aux, vaux);
if (!sub.outs)
err("Value to set variable must have nonzero arity!", m);
// What if we are setting a stack variable?
if (vaux.dupvars.count(node.args[0].val)) {
int h = vaux.height - vaux.dupvars[node.args[0].val];
if (h > 16) err("Too deep for stack variable (max 16)", m);
Node nodelist[] = {
sub.code,
token("SWAP"+unsignedToDecimal(h), m),
token("POP", m)
};
return pd(sub.aux, multiToken(nodelist, 3, m), 0);
}
// Setting a memory variable
else {
Node nodelist[] = {
sub.code,
varNode,
token("MSTORE", m),
};
return pd(sub.aux, multiToken(nodelist, 3, m), 0);
}
}
// Get variable
else if (node.val == "get") {
// Getting a stack variable
if (vaux.dupvars.count(node.args[0].val)) {
int h = vaux.height - vaux.dupvars[node.args[0].val];
if (h > 16) err("Too deep for stack variable (max 16)", m);
return pd(aux, token("DUP"+unsignedToDecimal(h)), 1);
}
// Getting a memory variable
else {
Node nodelist[] =
{ varNode, token("MLOAD", m) };
return pd(aux, multiToken(nodelist, 2, m), 1);
}
}
// Refer variable
else if (node.val == "ref") {
if (vaux.dupvars.count(node.args[0].val))
err("Cannot ref stack variable!", m);
return pd(aux, varNode, 1);
}
}
// Comments do nothing
else if (node.val == "comment") {
Node nodelist[] = { };
return pd(aux, multiToken(nodelist, 0, m), 0);
}
// Custom operation sequence
// eg. (ops bytez id msize swap1 msize add 0 swap1 mstore) == alloc
if (node.val == "ops") {
std::vector<Node> subs2;
int depth = 0;
for (unsigned i = 0; i < node.args.size(); i++) {
std::string op = upperCase(node.args[i].val);
if (node.args[i].type == ASTNODE || opinputs(op) == -1) {
programVerticalAux vaux2 = vaux;
vaux2.height = vaux.height - i - 1 + node.args.size();
programData sub = opcodeify(node.args[i], aux, vaux2);
aux = sub.aux;
depth += sub.outs;
subs2.push_back(sub.code);
}
else {
subs2.push_back(token(op, m));
depth += opoutputs(op) - opinputs(op);
}
}
if (depth < 0 || depth > 1) err("Stack depth mismatch", m);
return pd(aux, astnode("_", subs2, m), 0);
}
// Code blocks
if (node.val == "lll" && node.args.size() == 2) {
if (node.args[1].val != "0") aux.allocUsed = true;
std::vector<Node> o;
o.push_back(finalize(opcodeify(node.args[0])));
programData sub = opcodeify(node.args[1], aux, vaux);
Node code = astnode("____CODE", o, m);
Node nodelist[] = {
token("$begincode"+symb+".endcode"+symb, m), token("DUP1", m),
token("$begincode"+symb, m), sub.code, token("CODECOPY", m),
token("$endcode"+symb, m), token("JUMP", m),
token("~begincode"+symb, m), code,
token("~endcode"+symb, m), token("JUMPDEST", m)
};
return pd(sub.aux, multiToken(nodelist, 11, m), 1);
}
// Stack variables
if (node.val == "with") {
programData initial = opcodeify(node.args[1], aux, vaux);
programVerticalAux vaux2 = vaux;
vaux2.dupvars[node.args[0].val] = vaux.height;
vaux2.height += 1;
if (!initial.outs)
err("Initial variable value must have nonzero arity!", m);
programData sub = opcodeify(node.args[2], initial.aux, vaux2);
Node nodelist[] = {
initial.code,
sub.code
};
programData o = pd(sub.aux, multiToken(nodelist, 2, m), sub.outs);
if (sub.outs)
o.code.args.push_back(token("SWAP1", m));
o.code.args.push_back(token("POP", m));
return o;
}
// Seq of multiple statements
if (node.val == "seq") {
std::vector<Node> children;
int lastOut = 0;
for (unsigned i = 0; i < node.args.size(); i++) {
programData sub = opcodeify(node.args[i], aux, vaux);
aux = sub.aux;
if (sub.outs == 1) {
if (i < node.args.size() - 1) sub.code = popwrap(sub.code);
else lastOut = 1;
}
children.push_back(sub.code);
}
return pd(aux, astnode("_", children, m), lastOut);
}
// 2-part conditional (if gets rewritten to unless in rewrites)
else if (node.val == "unless" && node.args.size() == 2) {
programData cond = opcodeify(node.args[0], aux, vaux);
programData action = opcodeify(node.args[1], cond.aux, vaux);
aux = action.aux;
if (!cond.outs) err("Condition of if/unless statement has arity 0", m);
if (action.outs) action.code = popwrap(action.code);
Node nodelist[] = {
cond.code,
token("$endif"+symb, m), token("JUMPI", m),
action.code,
token("~endif"+symb, m), token("JUMPDEST", m)
};
return pd(aux, multiToken(nodelist, 6, m), 0);
}
// 3-part conditional
else if (node.val == "if" && node.args.size() == 3) {
programData ifd = opcodeify(node.args[0], aux, vaux);
programData thend = opcodeify(node.args[1], ifd.aux, vaux);
programData elsed = opcodeify(node.args[2], thend.aux, vaux);
aux = elsed.aux;
if (!ifd.outs)
err("Condition of if/unless statement has arity 0", m);
// Handle cases where one conditional outputs something
// and the other does not
int outs = (thend.outs && elsed.outs) ? 1 : 0;
if (thend.outs > outs) thend.code = popwrap(thend.code);
if (elsed.outs > outs) elsed.code = popwrap(elsed.code);
Node nodelist[] = {
ifd.code,
token("ISZERO", m),
token("$else"+symb, m), token("JUMPI", m),
thend.code,
token("$endif"+symb, m), token("JUMP", m),
token("~else"+symb, m), token("JUMPDEST", m),
elsed.code,
token("~endif"+symb, m), token("JUMPDEST", m)
};
return pd(aux, multiToken(nodelist, 12, m), outs);
}
// While (rewritten to this in rewrites)
else if (node.val == "until") {
programData cond = opcodeify(node.args[0], aux, vaux);
programData action = opcodeify(node.args[1], cond.aux, vaux);
aux = action.aux;
if (!cond.outs)
err("Condition of while/until loop has arity 0", m);
if (action.outs) action.code = popwrap(action.code);
Node nodelist[] = {
token("~beg"+symb, m), token("JUMPDEST", m),
cond.code,
token("$end"+symb, m), token("JUMPI", m),
action.code,
token("$beg"+symb, m), token("JUMP", m),
token("~end"+symb, m), token("JUMPDEST", m),
};
return pd(aux, multiToken(nodelist, 10, m));
}
// Memory allocations
else if (node.val == "alloc") {
programData bytez = opcodeify(node.args[0], aux, vaux);
aux = bytez.aux;
if (!bytez.outs)
err("Alloc input has arity 0", m);
aux.allocUsed = true;
Node nodelist[] = {
bytez.code,
token("MSIZE", m), token("SWAP1", m), token("MSIZE", m),
token("ADD", m),
token("0", m), token("SWAP1", m), token("MSTORE", m)
};
return pd(aux, multiToken(nodelist, 8, m), 1);
}
// All other functions/operators
else {
std::vector<Node> subs2;
int depth = opinputs(upperCase(node.val));
if (depth == -1)
err("Not a function or opcode: "+node.val, m);
if ((int)node.args.size() != depth)
err("Invalid arity for "+node.val, m);
for (int i = node.args.size() - 1; i >= 0; i--) {
programVerticalAux vaux2 = vaux;
vaux2.height = vaux.height - i - 1 + node.args.size();
programData sub = opcodeify(node.args[i], aux, vaux2);
aux = sub.aux;
if (!sub.outs)
err("Input "+unsignedToDecimal(i)+" has arity 0", sub.code.metadata);
subs2.push_back(sub.code);
}
subs2.push_back(token(upperCase(node.val), m));
int outdepth = opoutputs(upperCase(node.val));
return pd(aux, astnode("_", subs2, m), outdepth);
}
}
// Adds necessary wrappers to a program
Node finalize(programData c) {
std::vector<Node> bottom;
Metadata m = c.code.metadata;
// If we are using both alloc and variables, we need to pre-zfill
// some memory
if ((c.aux.allocUsed || c.aux.calldataUsed) && c.aux.vars.size() > 0) {
Node nodelist[] = {
token("0", m),
token(unsignedToDecimal(c.aux.nextVarMem - 1)),
token("MSTORE8", m)
};
bottom.push_back(multiToken(nodelist, 3, m));
}
// The actual code
bottom.push_back(c.code);
return astnode("_", bottom, m);
}
//LLL -> code fragment tree
Node buildFragmentTree(Node node) {
return finalize(opcodeify(node));
}
// Builds a dictionary mapping labels to variable names
programAux buildDict(Node program, programAux aux, int labelLength) {
Metadata m = program.metadata;
// Token
if (program.type == TOKEN) {
if (isNumberLike(program)) {
aux.step += 1 + toByteArr(program.val, m).size();
}
else if (program.val[0] == '~') {
aux.vars[program.val.substr(1)] = unsignedToDecimal(aux.step);
}
else if (program.val[0] == '$') {
aux.step += labelLength + 1;
}
else aux.step += 1;
}
// A sub-program (ie. LLL)
else if (program.val == "____CODE") {
programAux auks = Aux();
for (unsigned i = 0; i < program.args.size(); i++) {
auks = buildDict(program.args[i], auks, labelLength);
}
for (std::map<std::string,std::string>::iterator it=auks.vars.begin();
it != auks.vars.end();
it++) {
aux.vars[(*it).first] = (*it).second;
}
aux.step += auks.step;
}
// Normal sub-block
else {
for (unsigned i = 0; i < program.args.size(); i++) {
aux = buildDict(program.args[i], aux, labelLength);
}
}
return aux;
}
// Applies that dictionary
Node substDict(Node program, programAux aux, int labelLength) {
Metadata m = program.metadata;
std::vector<Node> out;
std::vector<Node> inner;
if (program.type == TOKEN) {
if (program.val[0] == '$') {
std::string tokStr = "PUSH"+unsignedToDecimal(labelLength);
out.push_back(token(tokStr, m));
int dotLoc = program.val.find('.');
if (dotLoc == -1) {
std::string val = aux.vars[program.val.substr(1)];
inner = toByteArr(val, m, labelLength);
}
else {
std::string start = aux.vars[program.val.substr(1, dotLoc-1)],
end = aux.vars[program.val.substr(dotLoc + 1)],
dist = decimalSub(end, start);
inner = toByteArr(dist, m, labelLength);
}
out.push_back(astnode("_", inner, m));
}
else if (program.val[0] == '~') { }
else if (isNumberLike(program)) {
inner = toByteArr(program.val, m);
out.push_back(token("PUSH"+unsignedToDecimal(inner.size())));
out.push_back(astnode("_", inner, m));
}
else return program;
}
else {
for (unsigned i = 0; i < program.args.size(); i++) {
Node n = substDict(program.args[i], aux, labelLength);
if (n.type == TOKEN || n.args.size()) out.push_back(n);
}
}
return astnode("_", out, m);
}
// Compiled fragtree -> compiled fragtree without labels
Node dereference(Node program) {
int sz = treeSize(program) * 4;
int labelLength = 1;
while (sz >= 256) { labelLength += 1; sz /= 256; }
programAux aux = buildDict(program, Aux(), labelLength);
return substDict(program, aux, labelLength);
}
// Dereferenced fragtree -> opcodes
std::vector<Node> flatten(Node derefed) {
std::vector<Node> o;
if (derefed.type == TOKEN) {
o.push_back(derefed);
}
else {
for (unsigned i = 0; i < derefed.args.size(); i++) {
std::vector<Node> oprime = flatten(derefed.args[i]);
for (unsigned j = 0; j < oprime.size(); j++) o.push_back(oprime[j]);
}
}
return o;
}
// Opcodes -> bin
std::string serialize(std::vector<Node> codons) {
std::string o;
for (unsigned i = 0; i < codons.size(); i++) {
int v;
if (isNumberLike(codons[i])) {
v = decimalToUnsigned(codons[i].val);
}
else if (codons[i].val.substr(0,4) == "PUSH") {
v = 95 + decimalToUnsigned(codons[i].val.substr(4));
}
else {
v = opcode(codons[i].val);
}
o += (char)v;
}
return o;
}
// Bin -> opcodes
std::vector<Node> deserialize(std::string ser) {
std::vector<Node> o;
int backCount = 0;
for (unsigned i = 0; i < ser.length(); i++) {
unsigned char v = (unsigned char)ser[i];
std::string oper = op((int)v);
if (oper != "" && backCount <= 0) o.push_back(token(oper));
else if (v >= 96 && v < 128 && backCount <= 0) {
o.push_back(token("PUSH"+unsignedToDecimal(v - 95)));
}
else o.push_back(token(unsignedToDecimal(v)));
if (v >= 96 && v < 128 && backCount <= 0) {
backCount = v - 95;
}
else backCount--;
}
return o;
}
// Fragtree -> bin
std::string assemble(Node fragTree) {
return serialize(flatten(dereference(fragTree)));
}
// Fragtree -> tokens
std::vector<Node> prettyAssemble(Node fragTree) {
return flatten(dereference(fragTree));
}
// LLL -> bin
std::string compileLLL(Node program) {
return assemble(buildFragmentTree(program));
}
// LLL -> tokens
std::vector<Node> prettyCompileLLL(Node program) {
return prettyAssemble(buildFragmentTree(program));
}
// Converts a list of integer values to binary transaction data
std::string encodeDatalist(std::vector<std::string> vals) {
std::string o;
for (unsigned i = 0; i < vals.size(); i++) {
std::vector<Node> n = toByteArr(strToNumeric(vals[i]), Metadata(), 32);
for (unsigned j = 0; j < n.size(); j++) {
int v = decimalToUnsigned(n[j].val);
o += (char)v;
}
}
return o;
}
// Converts binary transaction data into a list of integer values
std::vector<std::string> decodeDatalist(std::string ser) {
std::vector<std::string> out;
for (unsigned i = 0; i < ser.length(); i+= 32) {
std::string o = "0";
for (unsigned j = i; j < i + 32; j++) {
int vj = (int)(unsigned char)ser[j];
o = decimalAdd(decimalMul(o, "256"), unsignedToDecimal(vj));
}
out.push_back(o);
}
return out;
}

View File

@ -0,0 +1,43 @@
#ifndef ETHSERP_COMPILER
#define ETHSERP_COMPILER
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
// Compiled fragtree -> compiled fragtree without labels
Node dereference(Node program);
// LLL -> fragtree
Node buildFragmentTree(Node program);
// Dereferenced fragtree -> opcodes
std::vector<Node> flatten(Node derefed);
// opcodes -> bin
std::string serialize(std::vector<Node> codons);
// Fragtree -> bin
std::string assemble(Node fragTree);
// Fragtree -> opcodes
std::vector<Node> prettyAssemble(Node fragTree);
// LLL -> bin
std::string compileLLL(Node program);
// LLL -> opcodes
std::vector<Node> prettyCompileLLL(Node program);
// bin -> opcodes
std::vector<Node> deserialize(std::string ser);
// Converts a list of integer values to binary transaction data
std::string encodeDatalist(std::vector<std::string> vals);
// Converts binary transaction data into a list of integer values
std::vector<std::string> decodeDatalist(std::string ser);
#endif

View File

@ -0,0 +1,11 @@
#include <libserpent/funcs.h>
#include <libserpent/bignum.h>
#include <iostream>
using namespace std;
int main() {
cout << printAST(compileToLLL(get_file_contents("examples/namecoin.se"))) << "\n";
cout << decimalSub("10234", "10234") << "\n";
cout << decimalSub("10234", "10233") << "\n";
}

View File

@ -0,0 +1,11 @@
x = msg.data[0]
steps = 0
while x > 1:
steps += 1
if (x % 2) == 0:
x /= 2
else:
x = 3 * x + 1
return(steps)

View File

@ -0,0 +1,274 @@
# Ethereum forks Counterparty in 340 lines of serpent
# Not yet tested
# assets[i] = a registered asset, assets[i].holders[j] = former or current i-holder
data assets[2^50](creator, name, calldate, callprice, dividend_paid, holders[2^50], holdersCount)
data nextAssetId
# holdersMap: holdersMap[addr][asset] = 1 if addr holds asset
data holdersMap[2^160][2^50]
# balances[x][y] = how much of y x holds
data balances[2^160][2^50]
# orders[a][b] = heap of indices to (c, d, e)
# = c offers to sell d units of a at a price of e units of b per 10^18 units
# of a
data orderbooks[2^50][2^50]
# store of general order data
data orders[2^50](seller, asset_sold, quantity, price)
data ordersCount
# data feeds
data feeds[2^50](owner, value)
data feedCount
# heap
data heap
extern heap: [register, push, pop, top, size]
data cfds[2^50](maker, acceptor, feed, asset, strike, leverage, min, max, maturity)
data cfdCount
data bets[2^50](maker, acceptor, feed, asset, makerstake, acceptorstake, eqtest, maturity)
data betCount
def init():
heap = create('heap.se')
# Add units (internal method)
def add(to, asset, value):
assert msg.sender == self
self.balances[to][asset] += value
# Add the holder to the holders list
if not self.holdersMap[to][asset]:
self.holdersMap[to][asset] = 1
c = self.assets[asset].holdersCount
self.assets[asset].holders[c] = to
self.assets[asset].holdersCount = c + 1
# Register a new asset
def register_asset(q, name, calldate, callprice):
newid = self.nextAssetId
self.assets[newid].creator = msg.sender
self.assets[newid].name = name
self.assets[newid].calldate = calldate
self.assets[newid].callprice = callprice
self.assets[newid].holders[0] = msg.sender
self.assets[newid].holdersCount = 1
self.balances[msg.sender][newid] = q
self.holdersMap[msg.sender][newid] = 1
# Send
def send(to, asset, value):
fromval = self.balances[msg.sender][asset]
if fromval >= value:
self.balances[msg.sender][asset] -= value
self.add(to, asset, value)
# Order
def mkorder(selling, buying, quantity, price):
# Make sure you have enough to pay for the order
assert self.balances[msg.sender][selling] >= quantity:
# Try to match existing orders
o = orderbooks[buying][selling]
if not o:
o = self.heap.register()
orderbooks[selling][buying] = o
sz = self.heap.size(o)
invprice = 10^36 / price
while quantity > 0 and sz > 0:
orderid = self.heap.pop()
p = self.orders[orderid].price
if p > invprice:
sz = 0
else:
q = self.orders[orderid].quantity
oq = min(q, quantity)
b = self.orders[orderid].seller
self.balances[msg.sender][selling] -= oq * p / 10^18
self.add(msg.sender, buying, oq)
self.add(b, selling, oq * p / 10^18)
self.orders[orderid].quantity = q - oq
if oq == q:
self.orders[orderid].seller = 0
self.orders[orderid].price = 0
self.orders[orderid].asset_sold = 0
quantity -= oq
sz -= 1
assert quantity > 0
# Make the order
c = self.ordersCount
self.orders[c].seller = msg.sender
self.orders[c].asset_sold = selling
self.orders[c].quantity = quantity
self.orders[c].price = price
self.ordersCount += 1
# Add it to the heap
o = orderbooks[selling][buying]
if not o:
o = self.heap.register()
orderbooks[selling][buying] = o
self.balances[msg.sender][selling] -= quantity
self.heap.push(o, price, c)
return(c)
def cancel_order(id):
if self.orders[id].seller == msg.sender:
self.orders[id].seller = 0
self.orders[id].price = 0
self.balances[msg.sender][self.orders[id].asset_sold] += self.orders[id].quantity
self.orders[id].quantity = 0
self.orders[id].asset_sold = 0
def register_feed():
c = self.feedCount
self.feeds[c].owner = msg.sender
self.feedCount = c + 1
return(c)
def set_feed(id, v):
if self.feeds[id].owner == msg.sender:
self.feeds[id].value = v
def mk_cfd_offer(feed, asset, strike, leverage, min, max, maturity):
b = self.balances[msg.sender][asset]
req = max((strike - min) * leverage, (strike - max) * leverage)
assert b >= req
self.balances[msg.sender][asset] = b - req
c = self.cfdCount
self.cfds[c].maker = msg.sender
self.cfds[c].feed = feed
self.cfds[c].asset = asset
self.cfds[c].strike = strike
self.cfds[c].leverage = leverage
self.cfds[c].min = min
self.cfds[c].max = max
self.cfds[c].maturity = maturity
self.cfdCount = c + 1
return(c)
def accept_cfd_offer(c):
assert not self.cfds[c].acceptor and self.cfds[c].maker
asset = self.cfds[c].asset
strike = self.cfds[c].strike
min = self.cfds[c].min
max = self.cfds[c].max
leverage = self.cfds[c].leverage
b = self.balances[msg.sender][asset]
req = max((min - strike) * leverage, (max - strike) * leverage)
assert b >= req
self.balances[msg.sender][asset] = b - req
self.cfds[c].acceptor = msg.sender
self.cfds[c].maturity += block.timestamp
def claim_cfd_offer(c):
asset = self.cfds[c].asset
strike = self.cfds[c].strike
min = self.cfds[c].min
max = self.cfds[c].max
leverage = self.cfds[c].leverage
v = self.feeds[self.cfds[c].feed].value
assert v <= min or v >= max or block.timestamp >= self.cfds[c].maturity
maker_req = max((strike - min) * leverage, (strike - max) * leverage)
acceptor_req = max((min - strike) * leverage, (max - strike) * leverage)
paydelta = (strike - v) * leverage
self.add(self.cfds[c].maker, asset, maker_req + paydelta)
self.add(self.cfds[c].acceptor, asset, acceptor_req - paydelta)
self.cfds[c].maker = 0
self.cfds[c].acceptor = 0
self.cfds[c].feed = 0
self.cfds[c].asset = 0
self.cfds[c].strike = 0
self.cfds[c].leverage = 0
self.cfds[c].min = 0
self.cfds[c].max = 0
self.cfds[c].maturity = 0
def withdraw_cfd_offer(c):
if self.cfds[c].maker == msg.sender and not self.cfds[c].acceptor:
asset = self.cfds[c].asset
strike = self.cfds[c].strike
min = self.cfds[c].min
max = self.cfds[c].max
leverage = self.cfds[c].leverage
maker_req = max((strike - min) * leverage, (strike - max) * leverage)
self.balances[self.cfds[c].maker][asset] += maker_req
self.cfds[c].maker = 0
self.cfds[c].acceptor = 0
self.cfds[c].feed = 0
self.cfds[c].asset = 0
self.cfds[c].strike = 0
self.cfds[c].leverage = 0
self.cfds[c].min = 0
self.cfds[c].max = 0
self.cfds[c].maturity = 0
def mk_bet_offer(feed, asset, makerstake, acceptorstake, eqtest, maturity):
assert self.balances[msg.sender][asset] >= makerstake
c = self.betCount
self.bets[c].maker = msg.sender
self.bets[c].feed = feed
self.bets[c].asset = asset
self.bets[c].makerstake = makerstake
self.bets[c].acceptorstake = acceptorstake
self.bets[c].eqtest = eqtest
self.bets[c].maturity = maturity
self.balances[msg.sender][asset] -= makerstake
self.betCount = c + 1
return(c)
def accept_bet_offer(c):
assert self.bets[c].maker and not self.bets[c].acceptor
asset = self.bets[c].asset
acceptorstake = self.bets[c].acceptorstake
assert self.balances[msg.sender][asset] >= acceptorstake
self.balances[msg.sender][asset] -= acceptorstake
self.bets[c].acceptor = msg.sender
def claim_bet_offer(c):
assert block.timestamp >= self.bets[c].maturity
v = self.feeds[self.bets[c].feed].value
totalstake = self.bets[c].makerstake + self.bets[c].acceptorstake
if v == self.bets[c].eqtest:
self.add(self.bets[c].maker, self.bets[c].asset, totalstake)
else:
self.add(self.bets[c].acceptor, self.bets[c].asset, totalstake)
self.bets[c].maker = 0
self.bets[c].feed = 0
self.bets[c].asset = 0
self.bets[c].makerstake = 0
self.bets[c].acceptorstake = 0
self.bets[c].eqtest = 0
self.bets[c].maturity = 0
def cancel_bet(c):
assert not self.bets[c].acceptor and msg.sender == self.bets[c].maker
self.balances[msg.sender][self.bets[c].asset] += self.bets[c].makerstake
self.bets[c].maker = 0
self.bets[c].feed = 0
self.bets[c].asset = 0
self.bets[c].makerstake = 0
self.bets[c].acceptorstake = 0
self.bets[c].eqtest = 0
self.bets[c].maturity = 0
def dividend(holder_asset, divvying_asset, ratio):
i = 0
sz = self.assets[holder_asset].holdersCount
t = 0
holders = array(sz)
payments = array(sz)
while i < sz:
holders[i] = self.assets[holder_asset].holders[i]
payments[i] = self.balances[holders[i]][holder_asset] * ratio / 10^18
t += payments[i]
i += 1
if self.balances[msg.sender][divvying_asset] >= t:
i = 0
while i < sz:
self.add(holders[i], divvying_asset, payments[i])
i += 1
self.balances[msg.sender][divvying_asset] -= t

View File

@ -0,0 +1,69 @@
data heaps[2^50](owner, size, nodes[2^50](key, value))
data heapIndex
def register():
i = self.heapIndex
self.heaps[i].owner = msg.sender
self.heapIndex = i + 1
return(i)
def push(heap, key, value):
assert msg.sender == self.heaps[heap].owner
sz = self.heaps[heap].size
self.heaps[heap].nodes[sz].key = key
self.heaps[heap].nodes[sz].value = value
k = sz + 1
while k > 1:
bottom = self.heaps[heap].nodes[k].key
top = self.heaps[heap].nodes[k/2].key
if bottom < top:
tvalue = self.heaps[heap].nodes[k/2].value
bvalue = self.heaps[heap].nodes[k].value
self.heaps[heap].nodes[k].key = top
self.heaps[heap].nodes[k].value = tvalue
self.heaps[heap].nodes[k/2].key = bottom
self.heaps[heap].nodes[k/2].value = bvalue
k /= 2
else:
k = 0
self.heaps[heap].size = sz + 1
def pop(heap):
sz = self.heaps[heap].size
assert sz
prevtop = self.heaps[heap].nodes[1].value
self.heaps[heap].nodes[1].key = self.heaps[heap].nodes[sz].key
self.heaps[heap].nodes[1].value = self.heaps[heap].nodes[sz].value
self.heaps[heap].nodes[sz].key = 0
self.heaps[heap].nodes[sz].value = 0
top = self.heaps[heap].nodes[1].key
k = 1
while k * 2 < sz:
bottom1 = self.heaps[heap].nodes[k * 2].key
bottom2 = self.heaps[heap].nodes[k * 2 + 1].key
if bottom1 < top and (bottom1 < bottom2 or k * 2 + 1 >= sz):
tvalue = self.heaps[heap].nodes[1].value
bvalue = self.heaps[heap].nodes[k * 2].value
self.heaps[heap].nodes[k].key = bottom1
self.heaps[heap].nodes[k].value = bvalue
self.heaps[heap].nodes[k * 2].key = top
self.heaps[heap].nodes[k * 2].value = tvalue
k = k * 2
elif bottom2 < top and bottom2 < bottom1 and k * 2 + 1 < sz:
tvalue = self.heaps[heap].nodes[1].value
bvalue = self.heaps[heap].nodes[k * 2 + 1].value
self.heaps[heap].nodes[k].key = bottom2
self.heaps[heap].nodes[k].value = bvalue
self.heaps[heap].nodes[k * 2 + 1].key = top
self.heaps[heap].nodes[k * 2 + 1].value = tvalue
k = k * 2 + 1
else:
k = sz
self.heaps[heap].size = sz - 1
return(prevtop)
def top(heap):
return(self.heaps[heap].nodes[1].value)
def size(heap):
return(self.heaps[heap].size)

View File

@ -0,0 +1,53 @@
data campaigns[2^80](recipient, goal, deadline, contrib_total, contrib_count, contribs[2^50](sender, value))
def create_campaign(id, recipient, goal, timelimit):
if self.campaigns[id].recipient:
return(0)
self.campaigns[id].recipient = recipient
self.campaigns[id].goal = goal
self.campaigns[id].deadline = block.timestamp + timelimit
def contribute(id):
# Update contribution total
total_contributed = self.campaigns[id].contrib_total + msg.value
self.campaigns[id].contrib_total = total_contributed
# Record new contribution
sub_index = self.campaigns[id].contrib_count
self.campaigns[id].contribs[sub_index].sender = msg.sender
self.campaigns[id].contribs[sub_index].value = msg.value
self.campaigns[id].contrib_count = sub_index + 1
# Enough funding?
if total_contributed >= self.campaigns[id].goal:
send(self.campaigns[id].recipient, total_contributed)
self.clear(id)
return(1)
# Expired?
if block.timestamp > self.campaigns[id].deadline:
i = 0
c = self.campaigns[id].contrib_count
while i < c:
send(self.campaigns[id].contribs[i].sender, self.campaigns[id].contribs[i].value)
i += 1
self.clear(id)
return(2)
def progress_report(id):
return(self.campaigns[id].contrib_total)
# Clearing function for internal use
def clear(id):
if self == msg.sender:
self.campaigns[id].recipient = 0
self.campaigns[id].goal = 0
self.campaigns[id].deadline = 0
c = self.campaigns[id].contrib_count
self.campaigns[id].contrib_count = 0
self.campaigns[id].contrib_total = 0
i = 0
while i < c:
self.campaigns[id].contribs[i].sender = 0
self.campaigns[id].contribs[i].value = 0
i += 1

View File

@ -0,0 +1,136 @@
# 0: current epoch
# 1: number of proposals
# 2: master currency
# 3: last winning market
# 4: last txid
# 5: long-term ema currency units purchased
# 6: last block when currency units purchased
# 7: ether allocated to last round
# 8: last block when currency units claimed
# 9: ether allocated to current round
# 1000+: [proposal address, market ID, totprice, totvolume]
init:
# We technically have two levels of epoch here. We have
# one epoch of 1000, to synchronize with the 1000 epoch
# of the market, and then 100 of those epochs make a
# meta-epoch (I'll nominate the term "seculum") over
# which the futarchy protocol will take place
contract.storage[0] = block.number / 1000
# The master currency of the futarchy. The futarchy will
# assign currency units to whoever the prediction market
# thinks will best increase the currency's value
master_currency = create('subcurrency.se')
contract.storage[2] = master_currency
code:
curepoch = block.number / 1000
prevepoch = contract.storage[0]
if curepoch > prevepoch:
if (curepoch % 100) > 50:
# Collect price data
# We take an average over 50 subepochs to determine
# the price of each asset, weighting by volume to
# prevent abuse
contract.storage[0] = curepoch
i = 0
numprop = contract.storage[1]
while i < numprop:
market = contract.storage[1001 + i * 4]
price = call(market, 2)
volume = call(market, 3)
contract.storage[1002 + i * 4] += price
contract.storage[1003 + i * 4] += volume * price
i += 1
if (curepoch / 100) > (prevepoch / 100):
# If we are entering a new seculum, we determine the
# market with the highest total average price
best = 0
bestmarket = 0
besti = 0
i = 0
while i < numprop:
curtotprice = contract.storage[1002 + i * 4]
curvolume = contract.storage[1002 + i * 4]
curavgprice = curtotprice / curvolume
if curavgprice > best:
best = curavgprice
besti = i
bestmarket = contract.storage[1003 + i * 4]
i += 1
# Reset the number of proposals to 0
contract.storage[1] = 0
# Reward the highest proposal
call(contract.storage[2], [best, 10^9, 0], 3)
# Record the winning market so we can later appropriately
# compensate the participants
contract.storage[2] = bestmarket
# The amount of ether allocated to the last round
contract.storage[7] = contract.storage[9]
# The amount of ether allocated to the next round
contract.storage[9] = contract.balance / 2
# Make a proposal [0, address]
if msg.data[0] == 0 and curepoch % 100 < 50:
pid = contract.storage[1]
market = create('market.se')
c1 = create('subcurrency.se')
c2 = create('subcurrency.se')
call(market, [c1, c2], 2)
contract.storage[1000 + pid * 4] = msg.data[1]
contract.storage[1001 + pid * 4] = market
contract.storage[1] += 1
# Claim ether [1, address]
# One unit of the first currency in the last round's winning
# market entitles you to a quantity of ether that was decided
# at the start of that epoch
elif msg.data[0] == 1:
first_subcurrency = call(contract.storage[2], 3)
# We ask the first subcurrency contract what the last transaction was. The
# way to make a claim is to send the amount of first currency units that
# you wish to claim with, and then immediately call this contract. For security
# it makes sense to set up a tx which sends both messages in sequence atomically
data = call(first_subcurrency, [], 0, 4)
from = data[0]
to = data[1]
value = data[2]
txid = data[3]
if txid > contract.storage[4] and to == contract.address:
send(to, contract.storage[7] * value / 10^9)
contract.storage[4] = txid
# Claim second currency [2, address]
# One unit of the second currency in the last round's winning
# market entitles you to one unit of the futarchy's master
# currency
elif msg.data[0] == 2:
second_subcurrency = call(contract.storage[2], 3)
data = call(first_subcurrency, [], 0, 4)
from = data[0]
to = data[1]
value = data[2]
txid = data[3]
if txid > contract.storage[4] and to == contract.address:
call(contract.storage[2], [to, value], 2)
contract.storage[4] = txid
# Purchase currency for ether (target releasing 10^9 units per seculum)
# Price starts off 1 eth for 10^9 units but increases hyperbolically to
# limit issuance
elif msg.data[0] == 3:
pre_ema = contract.storage[5]
post_ema = pre_ema + msg.value
pre_reserve = 10^18 / (10^9 + pre_ema / 10^9)
post_reserve = 10^18 / (10^9 + post_ema / 10^9)
call(contract.storage[2], [msg.sender, pre_reserve - post_reserve], 2)
last_sold = contract.storage[6]
contract.storage[5] = pre_ema * (100000 + last_sold - block.number) + msg.value
contract.storage[6] = block.number
# Claim all currencies as the ether miner of the current block
elif msg.data[0] == 2 and msg.sender == block.coinbase and block.number > contract.storage[8]:
i = 0
numproposals = contract.storage[1]
while i < numproposals:
market = contract.storage[1001 + i * 3]
fc = call(market, 4)
sc = call(market, 5)
call(fc, [msg.sender, 1000], 2)
call(sc, [msg.sender, 1000], 2)
i += 1
contract.storage[8] = block.number

View File

@ -0,0 +1,55 @@
# 0: size
# 1-n: elements
init:
contract.storage[1000] = msg.sender
code:
# Only owner of the heap is allowed to modify it
if contract.storage[1000] != msg.sender:
stop
# push
if msg.data[0] == 0:
sz = contract.storage[0]
contract.storage[sz + 1] = msg.data[1]
k = sz + 1
while k > 1:
bottom = contract.storage[k]
top = contract.storage[k/2]
if bottom < top:
contract.storage[k] = top
contract.storage[k/2] = bottom
k /= 2
else:
k = 0
contract.storage[0] = sz + 1
# pop
elif msg.data[0] == 1:
sz = contract.storage[0]
if !sz:
return(0)
prevtop = contract.storage[1]
contract.storage[1] = contract.storage[sz]
contract.storage[sz] = 0
top = contract.storage[1]
k = 1
while k * 2 < sz:
bottom1 = contract.storage[k * 2]
bottom2 = contract.storage[k * 2 + 1]
if bottom1 < top and (bottom1 < bottom2 or k * 2 + 1 >= sz):
contract.storage[k] = bottom1
contract.storage[k * 2] = top
k = k * 2
elif bottom2 < top and bottom2 < bottom1 and k * 2 + 1 < sz:
contract.storage[k] = bottom2
contract.storage[k * 2 + 1] = top
k = k * 2 + 1
else:
k = sz
contract.storage[0] = sz - 1
return(prevtop)
# top
elif msg.data[0] == 2:
return(contract.storage[1])
# size
elif msg.data[0] == 3:
return(contract.storage[0])

View File

@ -0,0 +1,117 @@
# Creates a decentralized market between any two subcurrencies
# Here, the first subcurrency is the base asset and the second
# subcurrency is the asset priced against the base asset. Hence,
# "buying" refers to trading the first for the second, and
# "selling" refers to trading the second for the first
# storage 0: buy orders
# storage 1: sell orders
# storage 1000: first subcurrency
# storage 1001: last first subcurrency txid
# storage 2000: second subcurrency
# storage 2001: last second subcurrency txid
# storage 3000: current epoch
# storage 4000: price
# storage 4001: volume
init:
# Heap for buy orders
contract.storage[0] = create('heap.se')
# Heap for sell orders
contract.storage[1] = create('heap.se')
code:
# Initialize with [ first_subcurrency, second_subcurrency ]
if !contract.storage[1000]:
contract.storage[1000] = msg.data[0] # First subcurrency
contract.storage[1001] = -1
contract.storage[2000] = msg.data[1] # Second subcurrency
contract.storage[2001] = -1
contract.storage[3000] = block.number / 1000
stop
first_subcurrency = contract.storage[1000]
second_subcurrency = contract.storage[2000]
buy_heap = contract.storage[0]
sell_heap = contract.storage[1]
# This contract operates in "epochs" of 100 blocks
# At the end of each epoch, we process all orders
# simultaneously, independent of order. This algorithm
# prevents front-running, and generates a profit from
# the spread. The profit is permanently kept in the
# market (ie. destroyed), making both subcurrencies
# more valuable
# Epoch transition code
if contract.storage[3000] < block.number / 100:
done = 0
volume = 0
while !done:
# Grab the top buy and sell order from each heap
topbuy = call(buy_heap, 1)
topsell = call(sell_heap, 1)
# An order is recorded in the heap as:
# Buys: (2^48 - 1 - price) * 2^208 + units of first currency * 2^160 + from
# Sells: price * 2^208 + units of second currency * 2^160 + from
buyprice = -(topbuy / 2^208)
buyfcvalue = (topbuy / 2^160) % 2^48
buyer = topbuy % 2^160
sellprice = topsell / 2^208
sellscvalue = (topsell / 2^160) % 2^48
seller = topsell % 2^160
# Heap empty, or no more matching orders
if not topbuy or not topsell or buyprice < sellprice:
done = 1
else:
# Add to volume counter
volume += buyfcvalue
# Calculate how much of the second currency the buyer gets, and
# how much of the first currency the seller gets
sellfcvalue = sellscvalue / buyprice
buyscvalue = buyfcvalue * sellprice
# Send the currency units along
call(second_subcurrency, [buyer, buyscvalue], 2)
call(first_subcurrency, [seller, sellfcvalue], 2)
if volume:
contract.storage[4000] = (buyprice + sellprice) / 2
contract.storage[4001] = volume
contract.storage[3000] = block.number / 100
# Make buy order [0, price]
if msg.data[0] == 0:
# We ask the first subcurrency contract what the last transaction was. The
# way to make a buy order is to send the amount of first currency units that
# you wish to buy with, and then immediately call this contract. For security
# it makes sense to set up a tx which sends both messages in sequence atomically
data = call(first_subcurrency, [], 0, 4)
from = data[0]
to = data[1]
value = data[2]
txid = data[3]
price = msg.data[1]
if txid > contract.storage[1001] and to == contract.address:
contract.storage[1001] = txid
# Adds the order to the heap
call(buy_heap, [0, -price * 2^208 + (value % 2^48) * 2^160 + from], 2)
# Make sell order [1, price]
elif msg.data[0] == 1:
# Same mechanics as buying
data = call(second_subcurrency, [], 0, 4)
from = data[0]
to = data[1]
value = data[2]
txid = data[3]
price = msg.data[1]
if txid > contract.storage[2001] and to == contract.address:
contract.storage[2001] = txid
call(sell_heap, [0, price * 2^208 + (value % 2^48) * 2^160 + from], 2)
# Ask for price
elif msg.data[0] == 2:
return(contract.storage[4000])
# Ask for volume
elif msg.data[0] == 3:
return(contract.storage[1000])
# Ask for first currency
elif msg.data[0] == 4:
return(contract.storage[2000])
# Ask for second currency
elif msg.data[0] == 5:
return(contract.storage[4001])

View File

@ -0,0 +1,35 @@
# Initialization
# Admin can issue and delete at will
init:
contract.storage[0] = msg.sender
code:
# If a message with one item is sent, that's a balance query
if msg.datasize == 1:
addr = msg.data[0]
return(contract.storage[addr])
# If a message with two items [to, value] are sent, that's a transfer request
elif msg.datasize == 2:
from = msg.sender
fromvalue = contract.storage[from]
to = msg.data[0]
value = msg.data[1]
if fromvalue >= value and value > 0 and to > 4:
contract.storage[from] = fromvalue - value
contract.storage[to] += value
contract.storage[2] = from
contract.storage[3] = to
contract.storage[4] = value
contract.storage[5] += 1
return(1)
return(0)
elif msg.datasize == 3 and msg.sender == contract.storage[0]:
# Admin can issue at will by sending a [to, value, 0] message
if msg.data[2] == 0:
contract.storage[msg.data[0]] += msg.data[1]
# Change admin [ newadmin, 0, 1 ]
# Set admin to 0 to disable administration
elif msg.data[2] == 1:
contract.storage[0] = msg.data[0]
# Fetch last transaction
else:
return([contract.storage[2], contract.storage[3], contract.storage[4], contract.storage[5]], 4)

View File

@ -0,0 +1,39 @@
from __future__ import print_function
import pyethereum
t = pyethereum.tester
s = t.state()
# Create currencies
c1 = s.contract('subcurrency.se')
print("First currency: %s" % c1)
c2 = s.contract('subcurrency.se')
print("First currency: %s" % c2)
# Allocate units
s.send(t.k0, c1, 0, [t.a0, 1000, 0])
s.send(t.k0, c1, 0, [t.a1, 1000, 0])
s.send(t.k0, c2, 0, [t.a2, 1000000, 0])
s.send(t.k0, c2, 0, [t.a3, 1000000, 0])
print("Allocated units")
# Market
m = s.contract('market.se')
s.send(t.k0, m, 0, [c1, c2])
# Place orders
s.send(t.k0, c1, 0, [m, 1000])
s.send(t.k0, m, 0, [0, 1200])
s.send(t.k1, c1, 0, [m, 1000])
s.send(t.k1, m, 0, [0, 1400])
s.send(t.k2, c2, 0, [m, 1000000])
s.send(t.k2, m, 0, [1, 800])
s.send(t.k3, c2, 0, [m, 1000000])
s.send(t.k3, m, 0, [1, 600])
print("Orders placed")
# Next epoch and ping
s.mine(100)
print("Mined 100")
s.send(t.k0, m, 0, [])
print("Updating")
# Check
assert s.send(t.k0, c2, 0, [t.a0]) == [800000]
assert s.send(t.k0, c2, 0, [t.a1]) == [600000]
assert s.send(t.k0, c1, 0, [t.a2]) == [833]
assert s.send(t.k0, c1, 0, [t.a3]) == [714]
print("Balance checks passed")

View File

@ -0,0 +1,12 @@
# Database updateable only by the original creator
data creator
def init():
self.creator = msg.sender
def update(k, v):
if msg.sender == self.creator:
self.storage[k] = v
def query(k):
return(self.storage[k])

View File

@ -0,0 +1,40 @@
# So I looked up on Wikipedia what Jacobian form actually is, and noticed that it's
# actually a rather different and more clever construction than the naive version
# that I created. It may possible to achieve a further 20-50% savings by applying
# that version.
extern all: [call]
data JORDANMUL
data JORDANADD
data EXP
def init():
self.JORDANMUL = create('jacobian_mul.se')
self.JORDANADD = create('jacobian_add.se')
self.EXP = create('modexp.se')
def call(h, v, r, s):
N = -432420386565659656852420866394968145599
P = -4294968273
h = mod(h, N)
r = mod(r, P)
s = mod(s, N)
Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240
Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424
x = r
xcubed = mulmod(mulmod(x, x, P), x, P)
beta = self.EXP.call(addmod(xcubed, 7, P), div(P + 1, 4), P)
# Static-gascost ghetto conditional
y_is_positive = mod(v, 2) xor mod(beta, 2)
y = beta * y_is_positive + (P - beta) * (1 - y_is_positive)
GZ = self.JORDANMUL.call(Gx, 1, Gy, 1, N - h, outsz=4)
XY = self.JORDANMUL.call(x, 1, y, 1, s, outsz=4)
COMB = self.JORDANADD.call(GZ[0], GZ[1], GZ[2], GZ[3], XY[0], XY[1], XY[2], XY[3], 1, outsz=5)
COMB[4] = self.EXP.call(r, N - 2, N)
Q = self.JORDANMUL.call(data=COMB, datasz=5, outsz=4)
ox = mulmod(Q[0], self.EXP.call(Q[1], P - 2, P), P)
oy = mulmod(Q[2], self.EXP.call(Q[3], P - 2, P), P)
return([ox, oy], 2)

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,32 @@
extern all: [call]
data DOUBLE
def init():
self.DOUBLE = create('jacobian_double.se')
def call(axn, axd, ayn, ayd, bxn, bxd, byn, byd):
if !axn and !ayn:
o = [bxn, bxd, byn, byd]
if !bxn and !byn:
o = [axn, axd, ayn, ayd]
if o:
return(o, 4)
with P = -4294968273:
if addmod(mulmod(axn, bxd, P), P - mulmod(axd, bxn, P), P) == 0:
if addmod(mulmod(ayn, byd, P), P - mulmod(ayd, byn, P), P) == 0:
return(self.DOUBLE.call(axn, axd, ayn, ayd, outsz=4), 4)
else:
return([0, 1, 0, 1], 4)
with mn = mulmod(addmod(mulmod(byn, ayd, P), P - mulmod(ayn, byd, P), P), mulmod(bxd, axd, P), P):
with md = mulmod(mulmod(byd, ayd, P), addmod(mulmod(bxn, axd, P), P - mulmod(axn, bxd, P), P), P):
with msqn = mulmod(mn, mn, P):
with msqd = mulmod(md, md, P):
with msqman = addmod(mulmod(msqn, axd, P), P - mulmod(msqd, axn, P), P):
with msqmad = mulmod(msqd, axd, P):
with xn = addmod(mulmod(msqman, bxd, P), P - mulmod(msqmad, bxn, P), P):
with xd = mulmod(msqmad, bxd, P):
with mamxn = mulmod(mn, addmod(mulmod(axn, xd, P), P - mulmod(xn, axd, P), P), P):
with mamxd = mulmod(md, mulmod(axd, xd, P), P):
with yn = addmod(mulmod(mamxn, ayd, P), P - mulmod(mamxd, ayn, P), P):
with yd = mulmod(mamxd, ayd, P):
return([xn, xd, yn, yd], 4)

View File

@ -0,0 +1,16 @@
def call(axn, axd, ayn, ayd):
if !axn and !ayn:
return([0, 1, 0, 1], 4)
with P = -4294968273:
# No need to add (A, 1) because A = 0 for bitcoin
with mn = mulmod(mulmod(mulmod(axn, axn, P), 3, P), ayd, P):
with md = mulmod(mulmod(axd, axd, P), mulmod(ayn, 2, P), P):
with msqn = mulmod(mn, mn, P):
with msqd = mulmod(md, md, P):
with xn = addmod(mulmod(msqn, axd, P), P - mulmod(msqd, mulmod(axn, 2, P), P), P):
with xd = mulmod(msqd, axd, P):
with mamxn = mulmod(addmod(mulmod(axn, xd, P), P - mulmod(axd, xn, P), P), mn, P):
with mamxd = mulmod(mulmod(axd, xd, P), md, P):
with yn = addmod(mulmod(mamxn, ayd, P), P - mulmod(mamxd, ayn, P), P):
with yd = mulmod(mamxd, ayd, P):
return([xn, xd, yn, yd], 4)

View File

@ -0,0 +1,37 @@
# Expected gas cost
#
# def expect(n, point_at_infinity=False):
# n = n % (2**256 - 432420386565659656852420866394968145599)
# if point_at_infinity:
# return 79
# if n == 0:
# return 34479
# L = int(1 + math.log(n) / math.log(2))
# H = len([x for x in b.encode(n, 2) if x == '1'])
# return 34221 + 94 * L + 343 * H
data DOUBLE
data ADD
def init():
self.DOUBLE = create('jacobian_double.se')
self.ADD = create('jacobian_add.se')
def call(axn, axd, ayn, ayd, n):
n = mod(n, -432420386565659656852420866394968145599)
if !axn * !ayn + !n: # Constant-gas version of !axn and !ayn or !n
return([0, 1, 0, 1], 4)
with o = [0, 0, 1, 0, 1, 0, 0, 0, 0]:
with b = 2 ^ 255:
while gt(b, 0):
if n & b:
~call(20000, self.DOUBLE, 0, o + 31, 129, o + 32, 128)
o[5] = axn
o[6] = axd
o[7] = ayn
o[8] = ayd
~call(20000, self.ADD, 0, o + 31, 257, o + 32, 128)
else:
~call(20000, self.DOUBLE, 0, o + 31, 129, o + 32, 128)
b = div(b, 2)
return(o + 32, 4)

View File

@ -0,0 +1,11 @@
def call(b, e, m):
with o = 1:
with bit = 2 ^ 255:
while gt(bit, 0):
# A touch of loop unrolling for 20% efficiency gain
o = mulmod(mulmod(o, o, m), b ^ !(!(e & bit)), m)
o = mulmod(mulmod(o, o, m), b ^ !(!(e & div(bit, 2))), m)
o = mulmod(mulmod(o, o, m), b ^ !(!(e & div(bit, 4))), m)
o = mulmod(mulmod(o, o, m), b ^ !(!(e & div(bit, 8))), m)
bit = div(bit, 16)
return(o)

View File

@ -0,0 +1,78 @@
import bitcoin as b
import math
import sys
def signed(o):
return map(lambda x: x - 2**256 if x >= 2**255 else x, o)
def hamming_weight(n):
return len([x for x in b.encode(n, 2) if x == '1'])
def binary_length(n):
return len(b.encode(n, 2))
def jacobian_mul_substitute(A, B, C, D, N):
if A == 0 and C == 0 or (N % b.N) == 0:
return {"gas": 86, "output": [0, 1, 0, 1]}
else:
output = b.jordan_multiply(((A, B), (C, D)), N)
return {
"gas": 35262 + 95 * binary_length(N % b.N) + 355 * hamming_weight(N % b.N),
"output": signed(list(output[0]) + list(output[1]))
}
def jacobian_add_substitute(A, B, C, D, E, F, G, H):
if A == 0 or E == 0:
gas = 149
elif (A * F - B * E) % b.P == 0:
if (C * H - D * G) % b.P == 0:
gas = 442
else:
gas = 177
else:
gas = 301
output = b.jordan_add(((A, B), (C, D)), ((E, F), (G, H)))
return {
"gas": gas,
"output": signed(list(output[0]) + list(output[1]))
}
def modexp_substitute(base, exp, mod):
return {
"gas": 5150,
"output": signed([pow(base, exp, mod) if mod > 0 else 0])
}
def ecrecover_substitute(z, v, r, s):
P, A, B, N, Gx, Gy = b.P, b.A, b.B, b.N, b.Gx, b.Gy
x = r
beta = pow(x*x*x+A*x+B, (P + 1) / 4, P)
BETA_PREMIUM = modexp_substitute(x, (P + 1) / 4, P)["gas"]
y = beta if v % 2 ^ beta % 2 else (P - beta)
Gz = b.jordan_multiply(((Gx, 1), (Gy, 1)), (N - z) % N)
GZ_PREMIUM = jacobian_mul_substitute(Gx, 1, Gy, 1, (N - z) % N)["gas"]
XY = b.jordan_multiply(((x, 1), (y, 1)), s)
XY_PREMIUM = jacobian_mul_substitute(x, 1, y, 1, s % N)["gas"]
Qr = b.jordan_add(Gz, XY)
QR_PREMIUM = jacobian_add_substitute(Gz[0][0], Gz[0][1], Gz[1][0], Gz[1][1],
XY[0][0], XY[0][1], XY[1][0], XY[1][1]
)["gas"]
Q = b.jordan_multiply(Qr, pow(r, N - 2, N))
Q_PREMIUM = jacobian_mul_substitute(Qr[0][0], Qr[0][1], Qr[1][0], Qr[1][1],
pow(r, N - 2, N))["gas"]
R_PREMIUM = modexp_substitute(r, N - 2, N)["gas"]
OX_PREMIUM = modexp_substitute(Q[0][1], P - 2, P)["gas"]
OY_PREMIUM = modexp_substitute(Q[1][1], P - 2, P)["gas"]
Q = b.from_jordan(Q)
return {
"gas": 991 + BETA_PREMIUM + GZ_PREMIUM + XY_PREMIUM + QR_PREMIUM +
Q_PREMIUM + R_PREMIUM + OX_PREMIUM + OY_PREMIUM,
"output": signed(Q)
}

View File

@ -0,0 +1,129 @@
import bitcoin as b
import random
import sys
import math
from pyethereum import tester as t
import substitutes
import time
vals = [random.randrange(2**256) for i in range(12)]
test_points = [list(p[0]) + list(p[1]) for p in
[b.jordan_multiply(((b.Gx, 1), (b.Gy, 1)), r) for r in vals]]
G = [b.Gx, 1, b.Gy, 1]
Z = [0, 1, 0, 1]
def neg_point(p):
return [p[0], b.P - p[1], p[2], b.P - p[3]]
s = t.state()
s.block.gas_limit = 10000000
t.gas_limit = 1000000
c = s.contract('modexp.se')
print "Starting modexp tests"
for i in range(0, len(vals) - 2, 3):
o1 = substitutes.modexp_substitute(vals[i], vals[i+1], vals[i+2])
o2 = s.profile(t.k0, c, 0, funid=0, abi=vals[i:i+3])
#assert o1["gas"] == o2["gas"], (o1, o2)
assert o1["output"] == o2["output"], (o1, o2)
c = s.contract('jacobian_add.se')
print "Starting addition tests"
for i in range(2):
P = test_points[i * 2]
Q = test_points[i * 2 + 1]
NP = neg_point(P)
o1 = substitutes.jacobian_add_substitute(*(P + Q))
o2 = s.profile(t.k0, c, 0, funid=0, abi=P + Q)
#assert o1["gas"] == o2["gas"], (o1, o2)
assert o1["output"] == o2["output"], (o1, o2)
o1 = substitutes.jacobian_add_substitute(*(P + NP))
o2 = s.profile(t.k0, c, 0, funid=0, abi=P + NP)
#assert o1["gas"] == o2["gas"], (o1, o2)
assert o1["output"] == o2["output"], (o1, o2)
o1 = substitutes.jacobian_add_substitute(*(P + P))
o2 = s.profile(t.k0, c, 0, funid=0, abi=P + P)
#assert o1["gas"] == o2["gas"], (o1, o2)
assert o1["output"] == o2["output"], (o1, o2)
o1 = substitutes.jacobian_add_substitute(*(P + Z))
o2 = s.profile(t.k0, c, 0, funid=0, abi=P + Z)
#assert o1["gas"] == o2["gas"], (o1, o2)
assert o1["output"] == o2["output"], (o1, o2)
o1 = substitutes.jacobian_add_substitute(*(Z + P))
o2 = s.profile(t.k0, c, 0, funid=0, abi=Z + P)
#assert o1["gas"] == o2["gas"], (o1, o2)
assert o1["output"] == o2["output"], (o1, o2)
c = s.contract('jacobian_mul.se')
print "Starting multiplication tests"
mul_tests = [
Z + [0],
Z + [vals[0]],
test_points[0] + [0],
test_points[1] + [b.N],
test_points[2] + [1],
test_points[2] + [2],
test_points[2] + [3],
test_points[2] + [4],
test_points[3] + [5],
test_points[3] + [6],
test_points[4] + [7],
test_points[4] + [2**254],
test_points[4] + [vals[1]],
test_points[4] + [vals[2]],
test_points[4] + [vals[3]],
test_points[5] + [2**256 - 1],
]
for i, test in enumerate(mul_tests):
print 'trying mul_test %i' % i, test
o1 = substitutes.jacobian_mul_substitute(*test)
o2 = s.profile(t.k0, c, 0, funid=0, abi=test)
# assert o1["gas"] == o2["gas"], (o1, o2, test)
assert o1["output"] == o2["output"], (o1, o2, test)
c = s.contract('ecrecover.se')
print "Starting ecrecover tests"
for i in range(5):
print 'trying ecrecover_test', vals[i*2], vals[i*2+1]
k = vals[i*2]
h = vals[i*2+1]
V, R, S = b.ecdsa_raw_sign(b.encode(h, 256, 32), k)
aa = time.time()
o1 = substitutes.ecrecover_substitute(h, V, R, S)
print 'sub', time.time() - aa
a = time.time()
o2 = s.profile(t.k0, c, 0, funid=0, abi=[h, V, R, S])
print time.time() - a
# assert o1["gas"] == o2["gas"], (o1, o2, h, V, R, S)
assert o1["output"] == o2["output"], (o1, o2, h, V, R, S)
# Explicit tests
data = [[
0xf007a9c78a4b2213220adaaf50c89a49d533fbefe09d52bbf9b0da55b0b90b60,
0x1b,
0x5228fc9e2fabfe470c32f459f4dc17ef6a0a81026e57e4d61abc3bc268fc92b5,
0x697d4221cd7bc5943b482173de95d3114b9f54c5f37cc7f02c6910c6dd8bd107
]]
for datum in data:
o1 = substitutes.ecrecover_substitute(*datum)
o2 = s.profile(t.k0, c, 0, funid=0, abi=datum)
#assert o1["gas"] == o2["gas"], (o1, o2, datum)
assert o1["output"] == o2["output"], (o1, o2, datum)

View File

@ -0,0 +1,45 @@
if msg.data[0] == 0:
new_id = contract.storage[-1]
# store [from, to, value, maxvalue, timeout] in contract storage
contract.storage[new_id] = msg.sender
contract.storage[new_id + 1] = msg.data[1]
contract.storage[new_id + 2] = 0
contract.storage[new_id + 3] = msg.value
contract.storage[new_id + 4] = 2^254
# increment next id
contract.storage[-1] = new_id + 10
# return id of this channel
return(new_id)
# Increase payment on channel: [1, id, value, v, r, s]
elif msg.data[0] == 1:
# Ecrecover native extension; will be a different address in testnet and live
ecrecover = 0x46a8d0b21b1336d83b06829f568d7450df36883f
# Message data parameters
id = msg.data[1] % 2^160
value = msg.data[2]
# Determine sender from signature
h = sha3([id, value], 2)
sender = call(ecrecover, [h, msg.data[3], msg.data[4], msg.data[5]], 4)
# Check sender matches and new value is greater than old
if sender == contract.storage[id]:
if value > contract.storage[id + 2] and value <= contract.storage[id + 3]:
# Update channel, increasing value and setting timeout
contract.storage[id + 2] = value
contract.storage[id + 4] = block.number + 1000
# Cash out channel: [2, id]
elif msg.data[0] == 2:
id = msg.data[1] % 2^160
# Check if timeout has run out
if block.number >= contract.storage[id + 3]:
# Send funds
send(contract.storage[id + 1], contract.storage[id + 2])
# Send refund
send(contract.storage[id], contract.storage[id + 3] - contract.storage[id + 2])
# Clear storage
contract.storage[id] = 0
contract.storage[id + 1] = 0
contract.storage[id + 2] = 0
contract.storage[id + 3] = 0
contract.storage[id + 4] = 0

View File

@ -0,0 +1,19 @@
# An implementation of a contract for storing a key/value binding
init:
# Set owner
contract.storage[0] = msg.sender
code:
# Check ownership
if msg.sender == contract.storage[0]:
# Get: returns (found, val)
if msg.data[0] == 0:
s = sha3(msg.data[1])
return([contract.storage[s], contract.storage[s+1]], 2)
# Set: sets map[k] = v
elif msg.data[0] == 1:
s = sha3(msg.data[1])
contract.storage[s] = 1
contract.storage[s + 1] = msg.data[2]
# Suicide
elif msg.data[2] == 1:
suicide(0)

View File

@ -0,0 +1,14 @@
init:
contract.storage[0] = msg.sender
code:
if msg.sender != contract.storage[0]:
stop
i = 0
while i < ~calldatasize():
to = ~calldataload(i)
value = ~calldataload(i+20) / 256^12
datasize = ~calldataload(i+32) / 256^30
data = alloc(datasize)
~calldatacopy(data, i+34, datasize)
~call(tx.gas - 25, to, value, data, datasize, 0, 0)
i += 34 + datasize

View File

@ -0,0 +1,166 @@
# Exists in state:
# (i) last committed block
# (ii) chain of uncommitted blocks (linear only)
# (iii) transactions, each tx with an associated block number
#
# Uncommitted block =
# [ numtxs, numkvs, tx1 (N words), tx2 (N words) ..., [k1, v1], [k2, v2], [k3, v3] ... ]
#
# Block checking process
#
# Suppose last committed state is m
# Last uncommitted state is n
# Contested block is b
#
# 1. Temporarily apply all state transitions from
# m to b
# 2. Run code, get list of changes
# 3. Check is list of changes matches deltas
# * if yes, do nothing
# * if no, set last uncommitted state to pre-b
#
# Storage variables:
#
# Last committed block: 0
# Last uncommitted block: 1
# Contract holding code: 2
# Uncommitted map: 3
# Transaction length (parameter): 4
# Block b: 2^160 + b * 2^40:
# + 1: submission blknum
# + 2: submitter
# + 3: data in uncommitted block format above
# Last committed storage:
# sha3(k): index k
# Initialize: [0, c, txlength], set address of the code-holding contract and the transaction
# length
if not contract.storage[2]:
contract.storage[2] = msg.data[1]
contract.storage[4] = msg.data[2]
stop
# Sequentially commit all uncommitted blocks that are more than 1000 mainchain-blocks old
last_committed_block = contract.storage[0]
last_uncommitted_block = contract.storage[1]
lcb_storage_index = 2^160 + last_committed_block * 2^40
while contract.storage[lcb_storage_index + 1] < block.number - 1000 and last_committed_block < last_uncommitted_block:
kvpairs = contract.storage[lcb_storage_index]
i = 0
while i < kvpairs:
k = contract.storage[lcb_storage_index + 3 + i * 2]
v = contract.storage[lcb_storage_index + 4 + i * 2]
contract.storage[sha3(k)] = v
i += 1
last_committed_block += 1
lcb_storage_index += 2^40
contract.storage[0] = last_committed_block
# Propose block: [ 0, block number, data in block format above ... ]
if msg.data[0] == 0:
blknumber = msg.data[1]
# Block number must be correct
if blknumber != contract.storage[1]:
stop
# Deposit requirement
if msg.value < 10^19:
stop
# Store the proposal in storage as
# [ 0, main-chain block number, sender, block data...]
start_index = 2^160 + blknumber * 2^40
numkvs = (msg.datasize - 2) / 2
contract.storage[start_index + 1] = block.number
1ontract.storage[start_index + 2] = msg.sender
i = 0
while i < msg.datasize - 2:
contract.storage[start_index + 3 + i] = msg.data[2 + i]
i += 1
contract.storage[1] = blknumber + 1
# Challenge block: [ 1, b ]
elif msg.data[0] == 1:
blknumber = msg.data[1]
txwidth = contract.storage[4]
last_uncommitted_block = contract.storage[1]
last_committed_block = contract.storage[0]
# Cannot challenge nonexistent or committed blocks
if blknumber <= last_uncommitted_block or blknumber > last_committed_block:
stop
# Create a contract to serve as a map that maintains keys and values
# temporarily
tempstore = create('map.se')
contract.storage[3] = tempstore
# Unquestioningly apply the state transitions from the last committed block
# up to b
b = last_committed_block
cur_storage_index = 2^160 + last_committed_block * 2^40
while b < blknumber:
numtxs = contract.storage[cur_storage_index + 3]
numkvs = contract.storage[cur_storage_index + 4]
kv0index = cur_storage_index + 5 + numtxs * txwidth
i = 0
while i < numkvs:
k = contract.storage[kv0index + i * 2]
v = contract.storage[kx0index + i * 2 + 1]
call(tempstore, [1, k, v], 3)
i += 1
b += 1
cur_storage_index += 2^40
# Run the actual code, and see what state transitions it outputs
# The way that the code is expected to work is to:
#
# (1) take as input the list of transactions (the contract should
# use msg.datasize to determine how many txs there are, and it should
# be aware of the value of txwidth)
# (2) call this contract with [2, k] to read current state data
# (3) call this contract with [3, k, v] to write current state data
# (4) return as output a list of all state transitions that it made
# in the form [kvcount, k1, v1, k2, v2 ... ]
#
# The reason for separating (2) from (3) is that sometimes the state
# transition may end up changing a given key many times, and we don't
# need to inefficiently store that in storage
numkvs = contract.storage[cur_storage_index + 3]
numtxs = contract.storage[cur_storage_index + 4]
# Populate input array
inpwidth = numtxs * txwidth
inp = array(inpwidth)
i = 0
while i < inpwidth:
inp[i] = contract.storage[cur_storage_index + 5 + i]
i += 1
out = call(contract.storage[2], inp, inpwidth, numkvs * 2 + 1)
# Check that the number of state transitions is the same
if out[0] != kvcount:
send(msg.sender, 10^19)
contract.storage[0] = last_committed_block
stop
kv0index = cur_storage_index + 5 + numtxs * txwidth
i = 0
while i < kvcount:
# Check that each individual state transition matches
k = contract.storage[kv0index + i * 2 + 1]
v = contract.storage[kv0index + i * 2 + 2]
if k != out[i * 2 + 1] or v != out[i * 2 + 2]:
send(msg.sender, 10^19)
contract.storage[0] = last_committed_block
stop
i += 1
# Suicide tempstore
call(tempstore, 2)
# Read data [2, k]
elif msg.data[0] == 2:
tempstore = contract.storage[3]
o = call(tempstore, [0, msg.data[1]], 2, 2)
if o[0]:
return(o[1])
else:
return contract.storage[sha3(msg.data[1])]
# Write data [3, k, v]
elif msg.data[0] == 3:
tempstore = contract.storage[3]
call(tempstore, [1, msg.data[1], msg.data[2]], 3, 2)

View File

@ -0,0 +1,31 @@
type f: [a, b, c, d, e]
macro f($a) + f($b):
f(add($a, $b))
macro f($a) - f($b):
f(sub($a, $b))
macro f($a) * f($b):
f(mul($a, $b) / 10000)
macro f($a) / f($b):
f(sdiv($a * 10000, $b))
macro f($a) % f($b):
f(smod($a, $b))
macro f($v) = f($w):
$v = $w
macro unfify(f($a)):
$a / 10000
macro fify($a):
f($a * 10000)
a = fify(5)
b = fify(2)
c = a / b
e = c + (a / b)
return(unfify(e))

View File

@ -0,0 +1,116 @@
macro smin($a, $b):
with $1 = $a:
with $2 = $b:
if(slt($1, $2), $1, $2)
macro smax($a, $b):
with $1 = $a:
with $2 = $b:
if(slt($1, $2), $2, $1)
def omul(x, y):
o = expose(mklong(x) * mklong(y))
return(slice(o, 1), o[0]+1)
def oadd(x, y):
o = expose(mklong(x) + mklong(y))
return(slice(o, 1), o[0]+1)
def osub(x, y):
o = expose(mklong(x) - mklong(y))
return(slice(o, 1), o[0]+1)
def odiv(x, y):
o = expose(mklong(x) / mklong(y))
return(slice(o, 1), o[0]+1)
def comb(a:a, b:a, sign):
sz = smax(a[0], b[0])
msz = smin(a[0], b[0])
c = array(sz + 2)
c[0] = sz
i = 0
carry = 0
while i < msz:
m = a[i + 1] + sign * b[i + 1] + carry
c[i + 1] = mod(m + 2^127, 2^128) - 2^127
carry = (div(m + 2^127, 2^128) + 2^127) % 2^128 - 2^127
i += 1
u = if(a[0] > msz, a, b)
s = if(a[0] > msz, 1, sign)
while i < sz:
m = s * u[i + 1] + carry
c[i + 1] = mod(m + 2^127, 2^128) - 2^127
carry = (div(m + 2^127, 2^128) + 2^127) % 2^128 - 2^127
i += 1
if carry:
c[0] += 1
c[sz + 1] = carry
return(c, c[0]+1)
def mul(a:a, b:a):
c = array(a[0] + b[0] + 2)
c[0] = a[0] + b[0]
i = 0
while i < a[0]:
j = 0
carry = 0
while j < b[0]:
m = c[i + j + 1] + a[i + 1] * b[j + 1] + carry
c[i + j + 1] = mod(m + 2^127, 2^128) - 2^127
carry = (div(m + 2^127, 2^128) + 2^127) % 2^128 - 2^127
j += 1
if carry:
c[0] = a[0] + b[0] + 1
c[i + j + 1] += carry
i += 1
return(c, c[0]+1)
macro long($a) + long($b):
long(self.comb($a:$a[0]+1, $b:$b[0]+1, 1, outsz=$a[0]+$b[0]+2))
macro long($a) - long($b):
long(self.comb($a:$a[0]+1, $b:$b[0]+1, -1, outsz=$a[0]+$b[0]+2))
macro long($a) * long($b):
long(self.mul($a:$a[0]+1, $b:$b[0]+1, outsz=$a[0]+$b[0]+2))
macro long($a) / long($b):
long(self.div($a:$a[0]+1, $b:$b[0]+1, outsz=$a[0]+$b[0]+2))
macro mulexpand(long($a), $k, $m):
long:
with $c = array($a[0]+k+2):
$c[0] = $a[0]+$k
with i = 0:
while i < $a[0]:
v = $a[i+1] * $m + $c[i+$k+1]
$c[i+$k+1] = mod(v + 2^127, 2^128) - 2^127
$c[i+$k+2] = div(v + 2^127, 2^128)
i += 1
$c
def div(a:a, b:a):
asz = a[0]
bsz = b[0]
while b[bsz] == 0 and bsz > 0:
bsz -= 1
c = array(asz+2)
c[0] = asz+1
while 1:
while a[asz] == 0 and asz > 0:
asz -= 1
if asz < bsz:
return(c, c[0]+1)
sub = expose(mulexpand(long(b), asz - bsz, a[asz] / b[bsz]))
c[asz - bsz+1] = a[asz] / b[bsz]
a = expose(long(a) - long(sub))
a[asz-1] += 2^128 * a[asz]
a[asz] = 0
macro mklong($i):
long([2, mod($i + 2^127, 2^128) - 2^127, div($i + 2^127, 2^128)])
macro expose(long($i)):
$i

View File

@ -0,0 +1,2 @@
def double(v):
return(v*2)

View File

@ -0,0 +1,187 @@
# mutuala - subcurrency
# We want to issue a currency that reduces in value as you store it through negative interest.
# That negative interest would be stored in a commons account. It's like the p2p version of a
# capital tax
# the same things goes for transactions - you pay as you use the currency. However, the more
# you pay, the more you get to say about what the tax is used for
# each participant can propose a recipient for a payout to be made out of the commons account,
# others can vote on it by awarding it tax_credits.
# TODO should proposal have expiration timestamp?, after which the tax_credits are refunded
# TODO multiple proposals can take more credits that available in the Commons, how to handle this
# TODO how to handle lost accounts, after which no longer possible to get 2/3 majority
shared:
COMMONS = 42
ADMIN = 666
CAPITAL_TAX_PER_DAY = 7305 # 5% per year
PAYMENT_TAX = 20 # 5%
ACCOUNT_LIST_OFFSET = 2^160
ACCOUNT_MAP_OFFSET = 2^161
PROPOSAL_LIST_OFFSET = 2^162
PROPOSAL_MAP_OFFSET = 2^163
init:
contract.storage[ADMIN] = msg.sender
contract.storage[ACCOUNT_LIST_OFFSET - 1] = 1
contract.storage[ACCOUNT_LIST_OFFSET] = msg.sender
contract.storage[ACCOUNT_MAP_OFFSET + msg.sender] = 10^12
contract.storage[ACCOUNT_MAP_OFFSET + msg.sender + 1] = block.timestamp
# contract.storage[COMMONS] = balance commons
# contract.storage[ACCOUNT_LIST_OFFSET - 1] = number of accounts
# contract.storage[ACCOUNT_LIST_OFFSET + n] = account n
# contract.storage[PROPOSAL_LIST_OFFSET - 1] contains the number of proposals
# contract.storage[PROPOSAL_LIST_OFFSET + n] = proposal n
# per account:
# contract.storage[ACCOUNT_MAP_OFFSET + account] = balance
# contract.storage[ACCOUNT_MAP_OFFSET + account+1] = timestamp_last_transaction
# contract.storage[ACCOUNT_MAP_OFFSET + account+2] = tax_credits
# per proposal:
# contract.storage[PROPOSAL_MAP_OFFSET + proposal_id] = recipient
# contract.storage[PROPOSAL_MAP_OFFSET + proposal_id+1] = amount
# contract.storage[PROPOSAL_MAP_OFFSET + proposal_id+2] = total vote credits
code:
if msg.data[0] == "suicide" and msg.sender == contract.storage[ADMIN]:
suicide(msg.sender)
elif msg.data[0] == "balance":
addr = msg.data[1]
return(contract.storage[ACCOUNT_MAP_OFFSET + addr])
elif msg.data[0] == "pay":
from = msg.sender
fromvalue = contract.storage[ACCOUNT_MAP_OFFSET + from]
to = msg.data[1]
if to == 0 or to >= 2^160:
return([0, "invalid address"], 2)
value = msg.data[2]
tax = value / PAYMENT_TAX
if fromvalue >= value + tax:
contract.storage[ACCOUNT_MAP_OFFSET + from] = fromvalue - (value + tax)
contract.storage[ACCOUNT_MAP_OFFSET + to] += value
# tax
contract.storage[COMMONS] += tax
contract.storage[ACCOUNT_MAP_OFFSET + from + 2] += tax
# check timestamp field to see if target account exists
if contract.storage[ACCOUNT_MAP_OFFSET + to + 1] == 0:
# register new account
nr_accounts = contract.storage[ACCOUNT_LIST_OFFSET - 1]
contract.storage[ACCOUNT_LIST_OFFSET + nr_accounts] = to
contract.storage[ACCOUNT_LIST_OFFSET - 1] += 1
contract.storage[ACCOUNT_MAP_OFFSET + to + 1] = block.timestamp
return(1)
else:
return([0, "insufficient balance"], 2)
elif msg.data[0] == "hash":
proposal_id = sha3(msg.data[1])
return(proposal_id)
elif msg.data[0] == "propose":
from = msg.sender
# check if sender has an account and has tax credits
if contract.storage[ACCOUNT_MAP_OFFSET + from + 2] == 0:
return([0, "sender has no tax credits"], 2)
proposal_id = sha3(msg.data[1])
# check if proposal doesn't already exist
if contract.storage[PROPOSAL_MAP_OFFSET + proposal_id]:
return([0, "proposal already exists"])
to = msg.data[2]
# check if recipient is a valid address and has an account (with timestamp)
if to == 0 or to >= 2^160:
return([0, "invalid address"], 2)
if contract.storage[ACCOUNT_MAP_OFFSET + to + 1] == 0:
return([0, "invalid to account"], 2)
value = msg.data[3]
# check if there is enough money in the commons account
if value > contract.storage[COMMONS]:
return([0, "not enough credits in commons"], 2)
# record proposal in list
nr_proposals = contract.storage[PROPOSAL_LIST_OFFSET - 1]
contract.storage[PROPOSAL_LIST_OFFSET + nr_proposals] = proposal_id
contract.storage[PROPOSAL_LIST_OFFSET - 1] += 1
# record proposal in map
contract.storage[PROPOSAL_MAP_OFFSET + proposal_id] = to
contract.storage[PROPOSAL_MAP_OFFSET + proposal_id + 1] = value
return(proposal_id)
elif msg.data[0] == "vote":
from = msg.sender
proposal_id = sha3(msg.data[1])
value = msg.data[2]
# check if sender has an account and has tax credits
if value < contract.storage[ACCOUNT_MAP_OFFSET + from + 2]:
return([0, "sender doesn't have enough tax credits"], 2)
# check if proposal exist
if contract.storage[PROPOSAL_MAP_OFFSET + proposal_id] == 0:
return([0, "proposal doesn't exist"], 2)
# increase votes
contract.storage[PROPOSAL_MAP_OFFSET + proposal_id + 2] += value
# withdraw tax credits
contract.storage[ACCOUNT_MAP_OFFSET + from + 2] -= value
# did we reach 2/3 threshold?
if contract.storage[PROPOSAL_MAP_OFFSET + proposal_id + 2] >= contract.storage[COMMONS] * 2 / 3:
# got majority
to = contract.storage[PROPOSAL_MAP_OFFSET + proposal_id]
amount = contract.storage[PROPOSAL_MAP_OFFSET + proposal_id + 1]
# adjust balances
contract.storage[ACCOUNT_MAP_OFFSET + to] += amount
contract.storage[COMMONS] -= amount
# reset proposal
contract.storage[PROPOSAL_MAP_OFFSET + proposal_id] = 0
contract.storage[PROPOSAL_MAP_OFFSET + proposal_id + 1] = 0
contract.storage[PROPOSAL_MAP_OFFSET + proposal_id + 2] = 0
return(1)
return(proposal_id)
elif msg.data[0] == "tick":
nr_accounts = contract.storage[ACCOUNT_LIST_OFFSET - 1]
account_idx = 0
tax_paid = 0
# process all accounts and see if they have to pay their daily capital tax
while account_idx < nr_accounts:
cur_account = contract.storage[ACCOUNT_LIST_OFFSET + account_idx]
last_timestamp = contract.storage[ACCOUNT_MAP_OFFSET + cur_account + 1]
time_diff = block.timestamp - last_timestamp
if time_diff >= 86400:
tax_days = time_diff / 86400
balance = contract.storage[ACCOUNT_MAP_OFFSET + cur_account]
tax = tax_days * (balance / CAPITAL_TAX_PER_DAY)
if tax > 0:
# charge capital tax, but give tax credits in return
contract.storage[ACCOUNT_MAP_OFFSET + cur_account] -= tax
contract.storage[ACCOUNT_MAP_OFFSET + cur_account + 1] += tax_days * 86400
contract.storage[ACCOUNT_MAP_OFFSET + cur_account + 2] += tax
contract.storage[COMMONS] += tax
tax_paid += 1
account_idx += 1
return(tax_paid) # how many accounts did we charge tax on
else:
return([0, "unknown command"], 2)

View File

@ -0,0 +1,7 @@
def register(k, v):
if !self.storage[k]: # Is the key not yet taken?
# Then take it!
self.storage[k] = v
return(1)
else:
return(0) // Otherwise do nothing

View File

@ -0,0 +1,43 @@
macro padd($x, psuc($y)):
psuc(padd($x, $y))
macro padd($x, z()):
$x
macro dec(psuc($x)):
dec($x) + 1
macro dec(z()):
0
macro pmul($x, z()):
z()
macro pmul($x, psuc($y)):
padd(pmul($x, $y), $x)
macro pexp($x, z()):
one()
macro pexp($x, psuc($y)):
pmul($x, pexp($x, $y))
macro fac(z()):
one()
macro fac(psuc($x)):
pmul(psuc($x), fac($x))
macro one():
psuc(z())
macro two():
psuc(psuc(z()))
macro three():
psuc(psuc(psuc(z())))
macro five():
padd(three(), two())
return([dec(pmul(three(), pmul(three(), three()))), dec(fac(five()))], 2)

View File

@ -0,0 +1,4 @@
extern mul2: [double]
x = create("mul2.se")
return(x.double(5))

View File

@ -0,0 +1,33 @@
def kall():
argcount = ~calldatasize() / 32
if argcount == 1:
return(~calldataload(1))
args = array(argcount)
~calldatacopy(args, 1, argcount * 32)
low = array(argcount)
lsz = 0
high = array(argcount)
hsz = 0
i = 1
while i < argcount:
if args[i] < args[0]:
low[lsz] = args[i]
lsz += 1
else:
high[hsz] = args[i]
hsz += 1
i += 1
low = self.kall(data=low, datasz=lsz, outsz=lsz)
high = self.kall(data=high, datasz=hsz, outsz=hsz)
o = array(argcount)
i = 0
while i < lsz:
o[i] = low[i]
i += 1
o[lsz] = args[0]
j = 0
while j < hsz:
o[lsz + 1 + j] = high[j]
j += 1
return(o, argcount)

View File

@ -0,0 +1,46 @@
# Quicksort pairs
# eg. input of the form [ 30, 1, 90, 2, 70, 3, 50, 4]
# outputs [ 30, 1, 50, 4, 70, 3, 90, 2 ]
#
# Note: this can be used as a generalized sorting algorithm:
# map every object to [ key, ref ] where `ref` is the index
# in memory to all of the properties and `key` is the key to
# sort by
def kall():
argcount = ~calldatasize() / 64
if argcount == 1:
return([~calldataload(1), ~calldataload(33)], 2)
args = array(argcount * 2)
~calldatacopy(args, 1, argcount * 64)
low = array(argcount * 2)
lsz = 0
high = array(argcount * 2)
hsz = 0
i = 2
while i < argcount * 2:
if args[i] < args[0]:
low[lsz] = args[i]
low[lsz + 1] = args[i + 1]
lsz += 2
else:
high[hsz] = args[i]
high[hsz + 1] = args[i + 1]
hsz += 2
i = i + 2
low = self.kall(data=low, datasz=lsz, outsz=lsz)
high = self.kall(data=high, datasz=hsz, outsz=hsz)
o = array(argcount * 2)
i = 0
while i < lsz:
o[i] = low[i]
i += 1
o[lsz] = args[0]
o[lsz + 1] = args[1]
j = 0
while j < hsz:
o[lsz + 2 + j] = high[j]
j += 1
return(o, argcount * 2)

View File

@ -0,0 +1,94 @@
# SchellingCoin implementation
#
# Epoch length: 100 blocks
# Target savings depletion rate: 0.1% per epoch
data epoch
data hashes_submitted
data output
data quicksort_pairs
data accounts[2^160]
data submissions[2^80](hash, deposit, address, value)
extern any: [call]
def init():
self.epoch = block.number / 100
self.quicksort_pairs = create('quicksort_pairs.se')
def any():
if block.number / 100 > epoch:
# Sort all values submitted
N = self.hashes_submitted
o = array(N * 2)
i = 0
j = 0
while i < N:
v = self.submissions[i].value
if v:
o[j] = v
o[j + 1] = i
j += 2
i += 1
values = self.quicksort_pairs.call(data=o, datasz=j, outsz=j)
# Calculate total deposit, refund non-submitters and
# cleanup
deposits = array(j / 2)
addresses = array(j / 2)
i = 0
total_deposit = 0
while i < j / 2:
base_index = HASHES + values[i * 2 + 1] * 3
deposits[i] = self.submissions[i].deposit
addresses[i] = self.submissions[i].address
if self.submissions[values[i * 2 + 1]].value:
total_deposit += deposits[i]
else:
send(addresses[i], deposits[i] * 999 / 1000)
i += 1
inverse_profit_ratio = total_deposit / (contract.balance / 1000) + 1
# Reward everyone
i = 0
running_deposit_sum = 0
halfway_passed = 0
while i < j / 2:
new_deposit_sum = running_deposit_sum + deposits[i]
if new_deposit_sum > total_deposit / 4 and running_deposit_sum < total_deposit * 3 / 4:
send(addresses[i], deposits[i] + deposits[i] / inverse_profit_ratio * 2)
else:
send(addresses[i], deposits[i] - deposits[i] / inverse_profit_ratio)
if not halfway_passed and new_deposit_sum > total_deposit / 2:
self.output = self.submissions[i].value
halfway_passed = 1
self.submissions[i].value = 0
running_deposit_sum = new_deposit_sum
i += 1
self.epoch = block.number / 100
self.hashes_submitted = 0
def submit_hash(h):
if block.number % 100 < 50:
cur = self.hashes_submitted
pos = HASHES + cur * 3
self.submissions[cur].hash = h
self.submissions[cur].deposit = msg.value
self.submissions[cur].address = msg.sender
self.hashes_submitted = cur + 1
return(cur)
def submit_value(index, v):
if sha3([msg.sender, v], 2) == self.submissions[index].hash:
self.submissions[index].value = v
return(1)
def request_balance():
return(contract.balance)
def request_output():
return(self.output)

View File

@ -0,0 +1,171 @@
# Hedged zero-supply dollar implementation
# Uses SchellingCoin as price-determining backend
#
# Stored variables:
#
# 0: Schelling coin contract
# 1: Last epoch
# 2: Genesis block of contract
# 3: USD exposure
# 4: ETH exposure
# 5: Cached price
# 6: Last interest rate
# 2^160 + k: interest rate accumulator at k epochs
# 2^161 + ADDR * 3: eth-balance of a particular address
# 2^161 + ADDR * 3 + 1: usd-balance of a particular address
# 2^161 + ADDR * 3 + 1: last accessed epoch of a particular address
#
# Transaction types:
#
# [1, to, val]: send ETH
# [2, to, val]: send USD
# [3, wei_amount]: convert ETH to USD
# [4, usd_amount]: converts USD to ETH
# [5]: deposit
# [6, amount]: withdraw
# [7]: my balance query
# [7, acct]: balance query for any acct
# [8]: global state query
# [9]: liquidation test any account
#
# The purpose of the contract is to serve as a sort of cryptographic
# bank account where users can store both ETH and USD. ETH must be
# stored in zero or positive quantities, but USD balances can be
# positive or negative. If the USD balance is negative, the invariant
# usdbal * 10 >= ethbal * 9 must be satisfied; if any account falls
# below this value, then that account's balances are zeroed. Note
# that there is a 2% bounty to ping the app if an account does go
# below zero; one weakness is that if no one does ping then it is
# quite possible for accounts to go negative-net-worth, then zero
# themselves out, draining the reserves of the "bank" and potentially
# bankrupting it. A 0.1% fee on ETH <-> USD trade is charged to
# minimize this risk. Additionally, the bank itself will inevitably
# end up with positive or negative USD exposure; to mitigate this,
# it automatically updates interest rates on USD to keep exposure
# near zero.
data schelling_coin
data last_epoch
data starting_block
data usd_exposure
data eth_exposure
data price
data last_interest_rate
data interest_rate_accum[2^50]
data accounts[2^160](eth, usd, last_epoch)
extern sc: [submit_hash, submit_value, request_balance, request_output]
def init():
self.schelling_coin = create('schellingcoin.se')
self.price = self.schelling_coin.request_output()
self.interest_rate_accum[0] = 10^18
self.starting_block = block.number
def any():
sender = msg.sender
epoch = (block.number - self.starting_block) / 100
last_epoch = self.last_epoch
usdprice = self.price
# Update contract epochs
if epoch > last_epoch:
delta = epoch - last_epoch
last_interest_rate = self.last_interest_rate
usd_exposure - self.usd_exposure
last_accum = self.interest_rate_accum[last_epoch]
if usd_exposure < 0:
self.last_interest_rate = last_interest_rate - 10000 * delta
elif usd_exposure > 0:
self.last_interest_rate = last_interest_rate + 10000 * delta
self.interest_rate_accum[epoch] = last_accum + last_accum * last_interest_rate * delta / 10^9
# Proceeds go to support the SchellingCoin feeding it price data, ultimately providing the depositors
# of the SchellingCoin an interest rate
bal = max(self.balance - self.eth_exposure, 0) / 10000
usdprice = self.schelling_coin.request_output()
self.price = usdprice
self.last_epoch = epoch
ethbal = self.accounts[msg.sender].eth
usdbal = self.accounts[msg.sender].usd
# Apply interest rates to sender and liquidation-test self
if msg.sender != self:
self.ping(self)
def send_eth(to, value):
if value > 0 and value <= ethbal and usdbal * usdprice * 2 + (ethbal - value) >= 0:
self.accounts[msg.sender].eth = ethbal - value
self.ping(to)
self.accounts[to].eth += value
return(1)
def send_usd(to, value):
if value > 0 and value <= usdbal and (usdbal - value) * usdprice * 2 + ethbal >= 0:
self.accounts[msg.sender].usd = usdbal - value
self.ping(to)
self.accounts[to].usd += value
return(1)
def convert_to_eth(usdvalue):
ethplus = usdvalue * usdprice * 999 / 1000
if usdvalue > 0 and (usdbal - usdvalue) * usdprice * 2 + (ethbal + ethplus) >= 0:
self.accounts[msg.sender].eth = ethbal + ethplus
self.accounts[msg.sender].usd = usdbal - usdvalue
self.eth_exposure += ethplus
self.usd_exposure -= usdvalue
return([ethbal + ethplus, usdbal - usdvalue], 2)
def convert_to_usd(ethvalue):
usdplus = ethvalue / usdprice * 999 / 1000
if ethvalue > 0 and (usdbal + usdplus) * usdprice * 2 + (ethbal - ethvalue) >= 0:
self.accounts[msg.sender].eth = ethbal - ethvalue
self.accounts[msg.sender].usd = usdbal + usdplus
self.eth_exposure -= ethvalue
self.usd_exposure += usdplus
return([ethbal - ethvalue, usdbal + usdplus], 2)
def deposit():
self.accounts[msg.sender].eth = ethbal + msg.value
self.eth_exposure += msg.value
return(ethbal + msg.value)
def withdraw(value):
if value > 0 and value <= ethbal and usdbal * usdprice * 2 + (ethbal - value) >= 0:
self.accounts[msg.sender].eth -= value
self.eth_exposure -= value
return(ethbal - value)
def balance(acct):
self.ping(acct)
return([self.accounts[acct].eth, self.accounts[acct].usd], 2)
def global_state_query(acct):
interest = self.last_interest_rate
usd_exposure = self.usd_exposure
eth_exposure = self.eth_exposure
eth_balance = self.balance
return([epoch, usdprice, interest, usd_exposure, eth_exposure, eth_balance], 6)
def ping(acct):
account_last_epoch = self.accounts[acct].last_epoch
if account_last_epoch != epoch:
cur_usd_balance = self.accounts[acct].usd
new_usd_balance = cur_usd_balance * self.interest_rate_accum[epoch] / self.interest_rate_accum[account_last_epoch]
self.accounts[acct].usd = new_usd_balance
self.accounts[acct].last_epoch = epoch
self.usd_exposure += new_usd_balance - cur_usd_balance
ethbal = self.accounts[acct].eth
if new_usd_balance * usdval * 10 + ethbal * 9 < 0:
self.accounts[acct].eth = 0
self.accounts[acct].usd = 0
self.accounts[msg.sender].eth += ethbal / 50
self.eth_exposure += -ethbal + ethbal / 50
self.usd_exposure += new_usd_balance
return(1)
return(0)

View File

@ -0,0 +1 @@
return(sha3([msg.sender, msg.data[0]], 2))

View File

@ -0,0 +1,3 @@
def register(k, v):
if !self.storage[k]:
self.storage[k] = v

View File

@ -0,0 +1,11 @@
def init():
self.storage[msg.sender] = 1000000
def balance_query(k):
return(self.storage[addr])
def send(to, value):
fromvalue = self.storage[msg.sender]
if fromvalue >= value:
self.storage[from] = fromvalue - value
self.storage[to] += value

View File

@ -0,0 +1,35 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include "funcs.h"
#include "bignum.h"
#include "util.h"
#include "parser.h"
#include "lllparser.h"
#include "compiler.h"
#include "rewriter.h"
#include "tokenize.h"
Node compileToLLL(std::string input) {
return rewrite(parseSerpent(input));
}
Node compileChunkToLLL(std::string input) {
return rewriteChunk(parseSerpent(input));
}
std::string compile(std::string input) {
return compileLLL(compileToLLL(input));
}
std::vector<Node> prettyCompile(std::string input) {
return prettyCompileLLL(compileToLLL(input));
}
std::string compileChunk(std::string input) {
return compileLLL(compileChunkToLLL(input));
}
std::vector<Node> prettyCompileChunk(std::string input) {
return prettyCompileLLL(compileChunkToLLL(input));
}

View File

@ -0,0 +1,35 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include "bignum.h"
#include "util.h"
#include "parser.h"
#include "lllparser.h"
#include "compiler.h"
#include "rewriter.h"
#include "tokenize.h"
// Function listing:
//
// parseSerpent (serpent -> AST) std::string -> Node
// parseLLL (LLL -> AST) std::string -> Node
// rewrite (apply rewrite rules) Node -> Node
// compileToLLL (serpent -> LLL) std::string -> Node
// compileLLL (LLL -> EVMhex) Node -> std::string
// prettyCompileLLL (LLL -> EVMasm) Node -> std::vector<Node>
// prettyCompile (serpent -> EVMasm) std::string -> std::vector>Node>
// compile (serpent -> EVMhex) std::string -> std::string
// get_file_contents (filename -> file) std::string -> std::string
// exists (does file exist?) std::string -> bool
Node compileToLLL(std::string input);
Node compileChunkToLLL(std::string input);
std::string compile(std::string input);
std::vector<Node> prettyCompile(std::string input);
std::string compileChunk(std::string input);
std::vector<Node> prettyCompileChunk(std::string input);

View File

@ -0,0 +1,203 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "bignum.h"
#include "optimize.h"
#include "rewriteutils.h"
#include "preprocess.h"
#include "functions.h"
std::string getSignature(std::vector<Node> args) {
std::string o;
for (unsigned i = 0; i < args.size(); i++) {
if (args[i].val == ":" && args[i].args[1].val == "s")
o += "s";
else if (args[i].val == ":" && args[i].args[1].val == "a")
o += "a";
else
o += "i";
}
return o;
}
// Convert a list of arguments into a node containing a
// < datastart, datasz > pair
Node packArguments(std::vector<Node> args, std::string sig,
int funId, Metadata m) {
// Plain old 32 byte arguments
std::vector<Node> nargs;
// Variable-sized arguments
std::vector<Node> vargs;
// Variable sizes
std::vector<Node> sizes;
// Is a variable an array?
std::vector<bool> isArray;
// Fill up above three argument lists
int argCount = 0;
for (unsigned i = 0; i < args.size(); i++) {
Metadata m = args[i].metadata;
if (args[i].val == "=") {
// do nothing
}
else {
// Determine the correct argument type
char argType;
if (sig.size() > 0) {
if (argCount >= (signed)sig.size())
err("Too many args", m);
argType = sig[argCount];
}
else argType = 'i';
// Integer (also usable for short strings)
if (argType == 'i') {
if (args[i].val == ":")
err("Function asks for int, provided string or array", m);
nargs.push_back(args[i]);
}
// Long string
else if (argType == 's') {
if (args[i].val != ":")
err("Must specify string length", m);
vargs.push_back(args[i].args[0]);
sizes.push_back(args[i].args[1]);
isArray.push_back(false);
}
// Array
else if (argType == 'a') {
if (args[i].val != ":")
err("Must specify array length", m);
vargs.push_back(args[i].args[0]);
sizes.push_back(args[i].args[1]);
isArray.push_back(true);
}
else err("Invalid arg type in signature", m);
argCount++;
}
}
int static_arg_size = 1 + (vargs.size() + nargs.size()) * 32;
// Start off by saving the size variables and calculating the total
msn kwargs;
kwargs["funid"] = tkn(utd(funId), m);
std::string pattern =
"(with _sztot "+utd(static_arg_size)+" "
" (with _sizes (alloc "+utd(sizes.size() * 32)+") "
" (seq ";
for (unsigned i = 0; i < sizes.size(); i++) {
std::string sizeIncrement =
isArray[i] ? "(mul 32 _x)" : "_x";
pattern +=
"(with _x $sz"+utd(i)+"(seq "
" (mstore (add _sizes "+utd(i * 32)+") _x) "
" (set _sztot (add _sztot "+sizeIncrement+" )))) ";
kwargs["sz"+utd(i)] = sizes[i];
}
// Allocate memory, and set first data byte
pattern +=
"(with _datastart (alloc (add _sztot 32)) (seq "
" (mstore8 _datastart $funid) ";
// Copy over size variables
for (unsigned i = 0; i < sizes.size(); i++) {
int v = 1 + i * 32;
pattern +=
" (mstore "
" (add _datastart "+utd(v)+") "
" (mload (add _sizes "+utd(v-1)+"))) ";
}
// Store normal arguments
for (unsigned i = 0; i < nargs.size(); i++) {
int v = 1 + (i + sizes.size()) * 32;
pattern +=
" (mstore (add _datastart "+utd(v)+") $"+utd(i)+") ";
kwargs[utd(i)] = nargs[i];
}
// Loop through variable-sized arguments, store them
pattern +=
" (with _pos (add _datastart "+utd(static_arg_size)+") (seq";
for (unsigned i = 0; i < vargs.size(); i++) {
std::string copySize =
isArray[i] ? "(mul 32 (mload (add _sizes "+utd(i * 32)+")))"
: "(mload (add _sizes "+utd(i * 32)+"))";
pattern +=
" (unsafe_mcopy _pos $vl"+utd(i)+" "+copySize+") "
" (set _pos (add _pos "+copySize+")) ";
kwargs["vl"+utd(i)] = vargs[i];
}
// Return a 2-item array containing the start and size
pattern += " (array_lit _datastart _sztot))))))))";
std::string prefix = "_temp_"+mkUniqueToken();
// Fill in pattern, return triple
return subst(parseLLL(pattern), kwargs, prefix, m);
}
// Create a node for argument unpacking
Node unpackArguments(std::vector<Node> vars, Metadata m) {
std::vector<std::string> varNames;
std::vector<std::string> longVarNames;
std::vector<bool> longVarIsArray;
// Fill in variable and long variable names, as well as which
// long variables are arrays and which are strings
for (unsigned i = 0; i < vars.size(); i++) {
if (vars[i].val == ":") {
if (vars[i].args.size() != 2)
err("Malformed def!", m);
longVarNames.push_back(vars[i].args[0].val);
std::string tag = vars[i].args[1].val;
if (tag == "s")
longVarIsArray.push_back(false);
else if (tag == "a")
longVarIsArray.push_back(true);
else
err("Function value can only be string or array", m);
}
else {
varNames.push_back(vars[i].val);
}
}
std::vector<Node> sub;
if (!varNames.size() && !longVarNames.size()) {
// do nothing if we have no arguments
}
else {
std::vector<Node> varNodes;
for (unsigned i = 0; i < longVarNames.size(); i++)
varNodes.push_back(token(longVarNames[i], m));
for (unsigned i = 0; i < varNames.size(); i++)
varNodes.push_back(token(varNames[i], m));
// Copy over variable lengths and short variables
for (unsigned i = 0; i < varNodes.size(); i++) {
int pos = 1 + i * 32;
std::string prefix = (i < longVarNames.size()) ? "_len_" : "";
sub.push_back(asn("untyped", asn("set",
token(prefix+varNodes[i].val, m),
asn("calldataload", tkn(utd(pos), m), m),
m)));
}
// Copy over long variables
if (longVarNames.size() > 0) {
std::vector<Node> sub2;
int pos = varNodes.size() * 32 + 1;
Node tot = tkn("_tot", m);
for (unsigned i = 0; i < longVarNames.size(); i++) {
Node var = tkn(longVarNames[i], m);
Node varlen = longVarIsArray[i]
? asn("mul", tkn("32", m), tkn("_len_"+longVarNames[i], m))
: tkn("_len_"+longVarNames[i], m);
sub2.push_back(asn("untyped",
asn("set", var, asn("alloc", varlen))));
sub2.push_back(asn("calldatacopy", var, tot, varlen));
sub2.push_back(asn("set", tot, asn("add", tot, varlen)));
}
std::string prefix = "_temp_"+mkUniqueToken();
sub.push_back(subst(
astnode("with", tot, tkn(utd(pos), m), asn("seq", sub2)),
msn(),
prefix,
m));
}
}
return asn("seq", sub, m);
}

View File

@ -0,0 +1,39 @@
#ifndef ETHSERP_FUNCTIONS
#define ETHSERP_FUNCTIONS
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "bignum.h"
#include "optimize.h"
#include "rewriteutils.h"
#include "preprocess.h"
class argPack {
public:
argPack(Node a, Node b, Node c) {
pre = a;
datastart = b;
datasz = c;
}
Node pre;
Node datastart;
Node datasz;
};
// Get a signature from a function
std::string getSignature(std::vector<Node> args);
// Convert a list of arguments into a <pre, mstart, msize> node
// triple, given the signature of a function
Node packArguments(std::vector<Node> args, std::string sig,
int funId, Metadata m);
// Create a node for argument unpacking
Node unpackArguments(std::vector<Node> vars, Metadata m);
#endif

View File

@ -0,0 +1,70 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "tokenize.h"
struct _parseOutput {
Node node;
int newpos;
};
// Helper, returns subtree and position of start of next node
_parseOutput _parse(std::vector<Node> inp, int pos) {
Metadata met = inp[pos].metadata;
_parseOutput o;
// Bracket: keep grabbing tokens until we get to the
// corresponding closing bracket
if (inp[pos].val == "(" || inp[pos].val == "[") {
std::string fun, rbrack;
std::vector<Node> args;
pos += 1;
if (inp[pos].val == "[") {
fun = "access";
rbrack = "]";
}
else rbrack = ")";
// First argument is the function
while (inp[pos].val != ")") {
_parseOutput po = _parse(inp, pos);
if (fun.length() == 0 && po.node.type == 1) {
std::cerr << "Error: first arg must be function\n";
fun = po.node.val;
}
else if (fun.length() == 0) {
fun = po.node.val;
}
else {
args.push_back(po.node);
}
pos = po.newpos;
}
o.newpos = pos + 1;
o.node = astnode(fun, args, met);
}
// Normal token, return it and advance to next token
else {
o.newpos = pos + 1;
o.node = token(inp[pos].val, met);
}
return o;
}
// stream of tokens -> lisp parse tree
Node parseLLLTokenStream(std::vector<Node> inp) {
_parseOutput o = _parse(inp, 0);
return o.node;
}
// Parses LLL
Node parseLLL(std::string s, bool allowFileRead) {
std::string input = s;
std::string file = "main";
if (exists(s) && allowFileRead) {
file = s;
input = get_file_contents(s);
}
return parseLLLTokenStream(tokenize(s, Metadata(file, 0, 0), true));
}

View File

@ -0,0 +1,13 @@
#ifndef ETHSERP_LLLPARSER
#define ETHSERP_LLLPARSER
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
// LLL text -> parse tree
Node parseLLL(std::string s, bool allowFileRead=false);
#endif

View File

@ -0,0 +1,154 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "opcodes.h"
#include "util.h"
#include "bignum.h"
Mapping mapping[] = {
Mapping("STOP", 0x00, 0, 0),
Mapping("ADD", 0x01, 2, 1),
Mapping("MUL", 0x02, 2, 1),
Mapping("SUB", 0x03, 2, 1),
Mapping("DIV", 0x04, 2, 1),
Mapping("SDIV", 0x05, 2, 1),
Mapping("MOD", 0x06, 2, 1),
Mapping("SMOD", 0x07, 2, 1),
Mapping("ADDMOD", 0x08, 3, 1),
Mapping("MULMOD", 0x09, 3, 1),
Mapping("EXP", 0x0a, 2, 1),
Mapping("SIGNEXTEND", 0x0b, 2, 1),
Mapping("LT", 0x10, 2, 1),
Mapping("GT", 0x11, 2, 1),
Mapping("SLT", 0x12, 2, 1),
Mapping("SGT", 0x13, 2, 1),
Mapping("EQ", 0x14, 2, 1),
Mapping("ISZERO", 0x15, 1, 1),
Mapping("AND", 0x16, 2, 1),
Mapping("OR", 0x17, 2, 1),
Mapping("XOR", 0x18, 2, 1),
Mapping("NOT", 0x19, 1, 1),
Mapping("BYTE", 0x1a, 2, 1),
Mapping("SHA3", 0x20, 2, 1),
Mapping("ADDRESS", 0x30, 0, 1),
Mapping("BALANCE", 0x31, 1, 1),
Mapping("ORIGIN", 0x32, 0, 1),
Mapping("CALLER", 0x33, 0, 1),
Mapping("CALLVALUE", 0x34, 0, 1),
Mapping("CALLDATALOAD", 0x35, 1, 1),
Mapping("CALLDATASIZE", 0x36, 0, 1),
Mapping("CALLDATACOPY", 0x37, 3, 0),
Mapping("CODESIZE", 0x38, 0, 1),
Mapping("CODECOPY", 0x39, 3, 0),
Mapping("GASPRICE", 0x3a, 0, 1),
Mapping("EXTCODESIZE", 0x3b, 1, 1),
Mapping("EXTCODECOPY", 0x3c, 4, 0),
Mapping("PREVHASH", 0x40, 0, 1),
Mapping("COINBASE", 0x41, 0, 1),
Mapping("TIMESTAMP", 0x42, 0, 1),
Mapping("NUMBER", 0x43, 0, 1),
Mapping("DIFFICULTY", 0x44, 0, 1),
Mapping("GASLIMIT", 0x45, 0, 1),
Mapping("POP", 0x50, 1, 0),
Mapping("MLOAD", 0x51, 1, 1),
Mapping("MSTORE", 0x52, 2, 0),
Mapping("MSTORE8", 0x53, 2, 0),
Mapping("SLOAD", 0x54, 1, 1),
Mapping("SSTORE", 0x55, 2, 0),
Mapping("JUMP", 0x56, 1, 0),
Mapping("JUMPI", 0x57, 2, 0),
Mapping("PC", 0x58, 0, 1),
Mapping("MSIZE", 0x59, 0, 1),
Mapping("GAS", 0x5a, 0, 1),
Mapping("JUMPDEST", 0x5b, 0, 0),
Mapping("LOG0", 0xa0, 2, 0),
Mapping("LOG1", 0xa1, 3, 0),
Mapping("LOG2", 0xa2, 4, 0),
Mapping("LOG3", 0xa3, 5, 0),
Mapping("LOG4", 0xa4, 6, 0),
Mapping("CREATE", 0xf0, 3, 1),
Mapping("CALL", 0xf1, 7, 1),
Mapping("CALLCODE", 0xf2, 7, 1),
Mapping("RETURN", 0xf3, 2, 0),
Mapping("SUICIDE", 0xff, 1, 0),
Mapping("---END---", 0x00, 0, 0),
};
std::map<std::string, std::vector<int> > opcodes;
std::map<int, std::string> reverseOpcodes;
// Fetches everything EXCEPT PUSH1..32
std::pair<std::string, std::vector<int> > _opdata(std::string ops, int opi) {
if (!opcodes.size()) {
int i = 0;
while (mapping[i].op != "---END---") {
Mapping mi = mapping[i];
opcodes[mi.op] = triple(mi.opcode, mi.in, mi.out);
i++;
}
for (i = 1; i <= 16; i++) {
opcodes["DUP"+unsignedToDecimal(i)] = triple(0x7f + i, i, i+1);
opcodes["SWAP"+unsignedToDecimal(i)] = triple(0x8f + i, i+1, i+1);
}
for (std::map<std::string, std::vector<int> >::iterator it=opcodes.begin();
it != opcodes.end();
it++) {
reverseOpcodes[(*it).second[0]] = (*it).first;
}
}
ops = upperCase(ops);
std::string op;
std::vector<int> opdata;
op = reverseOpcodes.count(opi) ? reverseOpcodes[opi] : "";
opdata = opcodes.count(ops) ? opcodes[ops] : triple(-1, -1, -1);
return std::pair<std::string, std::vector<int> >(op, opdata);
}
int opcode(std::string op) {
return _opdata(op, -1).second[0];
}
int opinputs(std::string op) {
return _opdata(op, -1).second[1];
}
int opoutputs(std::string op) {
return _opdata(op, -1).second[2];
}
std::string op(int opcode) {
return _opdata("", opcode).first;
}
std::string lllSpecials[][3] = {
{ "ref", "1", "1" },
{ "get", "1", "1" },
{ "set", "2", "2" },
{ "with", "3", "3" },
{ "comment", "0", "2147483647" },
{ "ops", "0", "2147483647" },
{ "lll", "2", "2" },
{ "seq", "0", "2147483647" },
{ "if", "3", "3" },
{ "unless", "2", "2" },
{ "until", "2", "2" },
{ "alloc", "1", "1" },
{ "---END---", "0", "0" },
};
std::map<std::string, std::pair<int, int> > lllMap;
// Is a function name one of the valid functions above?
bool isValidLLLFunc(std::string f, int argc) {
if (lllMap.size() == 0) {
for (int i = 0; ; i++) {
if (lllSpecials[i][0] == "---END---") break;
lllMap[lllSpecials[i][0]] = std::pair<int, int>(
dtu(lllSpecials[i][1]), dtu(lllSpecials[i][2]));
}
}
return lllMap.count(f)
&& argc >= lllMap[f].first
&& argc <= lllMap[f].second;
}

View File

@ -0,0 +1,45 @@
#ifndef ETHSERP_OPCODES
#define ETHSERP_OPCODES
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
class Mapping {
public:
Mapping(std::string Op, int Opcode, int In, int Out) {
op = Op;
opcode = Opcode;
in = In;
out = Out;
}
std::string op;
int opcode;
int in;
int out;
};
extern Mapping mapping[];
extern std::map<std::string, std::vector<int> > opcodes;
extern std::map<int, std::string> reverseOpcodes;
std::pair<std::string, std::vector<int> > _opdata(std::string ops, int opi);
int opcode(std::string op);
int opinputs(std::string op);
int opoutputs(std::string op);
std::string op(int opcode);
extern std::string lllSpecials[][3];
extern std::map<std::string, std::pair<int, int> > lllMap;
bool isValidLLLFunc(std::string f, int argc);
#endif

View File

@ -0,0 +1,98 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "bignum.h"
// Compile-time arithmetic calculations
Node optimize(Node inp) {
if (inp.type == TOKEN) {
Node o = tryNumberize(inp);
if (decimalGt(o.val, tt256, true))
err("Value too large (exceeds 32 bytes or 2^256)", inp.metadata);
return o;
}
for (unsigned i = 0; i < inp.args.size(); i++) {
inp.args[i] = optimize(inp.args[i]);
}
// Arithmetic-specific transform
if (inp.val == "+") inp.val = "add";
if (inp.val == "*") inp.val = "mul";
if (inp.val == "-") inp.val = "sub";
if (inp.val == "/") inp.val = "sdiv";
if (inp.val == "^") inp.val = "exp";
if (inp.val == "**") inp.val = "exp";
if (inp.val == "%") inp.val = "smod";
// Degenerate cases for add and mul
if (inp.args.size() == 2) {
if (inp.val == "add" && inp.args[0].type == TOKEN &&
inp.args[0].val == "0") {
Node x = inp.args[1];
inp = x;
}
if (inp.val == "add" && inp.args[1].type == TOKEN &&
inp.args[1].val == "0") {
Node x = inp.args[0];
inp = x;
}
if (inp.val == "mul" && inp.args[0].type == TOKEN &&
inp.args[0].val == "1") {
Node x = inp.args[1];
inp = x;
}
if (inp.val == "mul" && inp.args[1].type == TOKEN &&
inp.args[1].val == "1") {
Node x = inp.args[0];
inp = x;
}
}
// Arithmetic computation
if (inp.args.size() == 2
&& inp.args[0].type == TOKEN
&& inp.args[1].type == TOKEN) {
std::string o;
if (inp.val == "add") {
o = decimalMod(decimalAdd(inp.args[0].val, inp.args[1].val), tt256);
}
else if (inp.val == "sub") {
if (decimalGt(inp.args[0].val, inp.args[1].val, true))
o = decimalSub(inp.args[0].val, inp.args[1].val);
}
else if (inp.val == "mul") {
o = decimalMod(decimalMul(inp.args[0].val, inp.args[1].val), tt256);
}
else if (inp.val == "div" && inp.args[1].val != "0") {
o = decimalDiv(inp.args[0].val, inp.args[1].val);
}
else if (inp.val == "sdiv" && inp.args[1].val != "0"
&& decimalGt(tt255, inp.args[0].val)
&& decimalGt(tt255, inp.args[1].val)) {
o = decimalDiv(inp.args[0].val, inp.args[1].val);
}
else if (inp.val == "mod" && inp.args[1].val != "0") {
o = decimalMod(inp.args[0].val, inp.args[1].val);
}
else if (inp.val == "smod" && inp.args[1].val != "0"
&& decimalGt(tt255, inp.args[0].val)
&& decimalGt(tt255, inp.args[1].val)) {
o = decimalMod(inp.args[0].val, inp.args[1].val);
}
else if (inp.val == "exp") {
o = decimalModExp(inp.args[0].val, inp.args[1].val, tt256);
}
if (o.length()) return token(o, inp.metadata);
}
return inp;
}
// Is a node degenerate (ie. trivial to calculate) ?
bool isDegenerate(Node n) {
return optimize(n).type == TOKEN;
}
// Is a node purely arithmetic?
bool isPureArithmetic(Node n) {
return isNumberLike(optimize(n));
}

View File

@ -0,0 +1,19 @@
#ifndef ETHSERP_OPTIMIZER
#define ETHSERP_OPTIMIZER
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
// Compile-time arithmetic calculations
Node optimize(Node inp);
// Is a node degenerate (ie. trivial to calculate) ?
bool isDegenerate(Node n);
// Is a node purely arithmetic?
bool isPureArithmetic(Node n);
#endif

View File

@ -0,0 +1,430 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "parser.h"
#include "tokenize.h"
// Extended BEDMAS precedence order
int precedence(Node tok) {
std::string v = tok.val;
if (v == ".") return -1;
else if (v == "!" || v == "not") return 1;
else if (v=="^" || v == "**") return 2;
else if (v=="*" || v=="/" || v=="%") return 3;
else if (v=="+" || v=="-") return 4;
else if (v=="<" || v==">" || v=="<=" || v==">=") return 5;
else if (v=="&" || v=="|" || v=="xor" || v=="==" || v == "!=") return 6;
else if (v=="&&" || v=="and") return 7;
else if (v=="||" || v=="or") return 8;
else if (v=="=") return 10;
else if (v=="+=" || v=="-=" || v=="*=" || v=="/=" || v=="%=") return 10;
else if (v==":" || v == "::") return 11;
else return 0;
}
// Token classification for shunting-yard purposes
int toktype(Node tok) {
if (tok.type == ASTNODE) return COMPOUND;
std::string v = tok.val;
if (v == "(" || v == "[" || v == "{") return LPAREN;
else if (v == ")" || v == "]" || v == "}") return RPAREN;
else if (v == ",") return COMMA;
else if (v == "!" || v == "~" || v == "not") return UNARY_OP;
else if (precedence(tok) > 0) return BINARY_OP;
else if (precedence(tok) < 0) return TOKEN_SPLITTER;
if (tok.val[0] != '"' && tok.val[0] != '\'') {
for (unsigned i = 0; i < tok.val.length(); i++) {
if (chartype(tok.val[i]) == SYMB) {
err("Invalid symbol: "+tok.val, tok.metadata);
}
}
}
return ALPHANUM;
}
// Converts to reverse polish notation
std::vector<Node> shuntingYard(std::vector<Node> tokens) {
std::vector<Node> iq;
for (int i = tokens.size() - 1; i >= 0; i--) {
iq.push_back(tokens[i]);
}
std::vector<Node> oq;
std::vector<Node> stack;
Node prev, tok;
int prevtyp = 0, toktyp = 0;
while (iq.size()) {
prev = tok;
prevtyp = toktyp;
tok = iq.back();
toktyp = toktype(tok);
iq.pop_back();
// Alphanumerics go straight to output queue
if (toktyp == ALPHANUM) {
oq.push_back(tok);
}
// Left parens go on stack and output queue
else if (toktyp == LPAREN) {
while (stack.size() && toktype(stack.back()) == TOKEN_SPLITTER) {
oq.push_back(stack.back());
stack.pop_back();
}
if (prevtyp != ALPHANUM && prevtyp != RPAREN) {
oq.push_back(token("id", tok.metadata));
}
stack.push_back(tok);
oq.push_back(tok);
}
// If rparen, keep moving from stack to output queue until lparen
else if (toktyp == RPAREN) {
while (stack.size() && toktype(stack.back()) != LPAREN) {
oq.push_back(stack.back());
stack.pop_back();
}
if (stack.size()) {
stack.pop_back();
}
oq.push_back(tok);
}
else if (toktyp == UNARY_OP) {
stack.push_back(tok);
}
// If token splitter, just push it to the stack
else if (toktyp == TOKEN_SPLITTER) {
while (stack.size() && toktype(stack.back()) == TOKEN_SPLITTER) {
oq.push_back(stack.back());
stack.pop_back();
}
stack.push_back(tok);
}
// If binary op, keep popping from stack while higher bedmas precedence
else if (toktyp == BINARY_OP) {
if (tok.val == "-" && prevtyp != ALPHANUM && prevtyp != RPAREN) {
stack.push_back(tok);
oq.push_back(token("0", tok.metadata));
}
else {
int prec = precedence(tok);
while (stack.size()
&& (toktype(stack.back()) == BINARY_OP
|| toktype(stack.back()) == UNARY_OP
|| toktype(stack.back()) == TOKEN_SPLITTER)
&& precedence(stack.back()) <= prec) {
oq.push_back(stack.back());
stack.pop_back();
}
stack.push_back(tok);
}
}
// Comma means finish evaluating the argument
else if (toktyp == COMMA) {
while (stack.size() && toktype(stack.back()) != LPAREN) {
oq.push_back(stack.back());
stack.pop_back();
}
}
}
while (stack.size()) {
oq.push_back(stack.back());
stack.pop_back();
}
return oq;
}
// Converts reverse polish notation into tree
Node treefy(std::vector<Node> stream) {
std::vector<Node> iq;
for (int i = stream.size() -1; i >= 0; i--) {
iq.push_back(stream[i]);
}
std::vector<Node> oq;
while (iq.size()) {
Node tok = iq.back();
iq.pop_back();
int typ = toktype(tok);
// If unary, take node off end of oq and wrap it with the operator
// If binary, do the same with two nodes
if (typ == UNARY_OP || typ == BINARY_OP || typ == TOKEN_SPLITTER) {
std::vector<Node> args;
int rounds = (typ == UNARY_OP) ? 1 : 2;
for (int i = 0; i < rounds; i++) {
if (oq.size() == 0) {
err("Line malformed, not enough args for "+tok.val,
tok.metadata);
}
args.push_back(oq.back());
oq.pop_back();
}
std::vector<Node> args2;
while (args.size()) {
args2.push_back(args.back());
args.pop_back();
}
oq.push_back(astnode(tok.val, args2, tok.metadata));
}
// If rparen, keep grabbing until we get to an lparen
else if (typ == RPAREN) {
std::vector<Node> args;
while (1) {
if (toktype(oq.back()) == LPAREN) break;
args.push_back(oq.back());
oq.pop_back();
if (!oq.size()) err("Bracket without matching", tok.metadata);
}
oq.pop_back();
args.push_back(oq.back());
oq.pop_back();
// We represent a[b] as (access a b)
if (tok.val == "]")
args.push_back(token("access", tok.metadata));
if (args.back().type == ASTNODE)
args.push_back(token("fun", tok.metadata));
std::string fun = args.back().val;
args.pop_back();
// We represent [1,2,3] as (array_lit 1 2 3)
if (fun == "access" && args.size() && args.back().val == "id") {
fun = "array_lit";
args.pop_back();
}
std::vector<Node> args2;
while (args.size()) {
args2.push_back(args.back());
args.pop_back();
}
// When evaluating 2 + (3 * 5), the shunting yard algo turns that
// into 2 ( id 3 5 * ) +, effectively putting "id" as a dummy
// function where the algo was expecting a function to call the
// thing inside the brackets. This reverses that step
if (fun == "id" && args2.size() == 1) {
oq.push_back(args2[0]);
}
else {
oq.push_back(astnode(fun, args2, tok.metadata));
}
}
else oq.push_back(tok);
// This is messy, but has to be done. Import/inset other files here
std::string v = oq.back().val;
if ((v == "inset" || v == "import" || v == "create")
&& oq.back().args.size() == 1
&& oq.back().args[0].type == TOKEN) {
int lastSlashPos = tok.metadata.file.rfind("/");
std::string root;
if (lastSlashPos >= 0)
root = tok.metadata.file.substr(0, lastSlashPos) + "/";
else
root = "";
std::string filename = oq.back().args[0].val;
filename = filename.substr(1, filename.length() - 2);
if (!exists(root + filename))
err("File does not exist: "+root + filename, tok.metadata);
oq.back().args.pop_back();
oq.back().args.push_back(parseSerpent(root + filename));
}
//Useful for debugging
//for (int i = 0; i < oq.size(); i++) {
// std::cerr << printSimple(oq[i]) << " ";
//}
//std::cerr << " <-\n";
}
// Output must have one argument
if (oq.size() == 0) {
err("Output blank", Metadata());
}
else if (oq.size() > 1) {
return asn("multi", oq, oq[0].metadata);
}
return oq[0];
}
// Parses one line of serpent
Node parseSerpentTokenStream(std::vector<Node> s) {
return treefy(shuntingYard(s));
}
// Count spaces at beginning of line
int spaceCount(std::string s) {
unsigned pos = 0;
while (pos < s.length() && (s[pos] == ' ' || s[pos] == '\t'))
pos++;
return pos;
}
// Is this a command that takes an argument on the same line?
bool bodied(std::string tok) {
return tok == "if" || tok == "elif" || tok == "while"
|| tok == "with" || tok == "def" || tok == "extern"
|| tok == "data" || tok == "assert" || tok == "return"
|| tok == "fun" || tok == "scope" || tok == "macro"
|| tok == "type";
}
// Are the two commands meant to continue each other?
bool bodiedContinued(std::string prev, std::string tok) {
return (prev == "if" && tok == "elif")
|| (prev == "elif" && tok == "else")
|| (prev == "elif" && tok == "elif")
|| (prev == "if" && tok == "else");
}
// Is a line of code empty?
bool isLineEmpty(std::string line) {
std::vector<Node> tokens = tokenize(line);
if (!tokens.size() || tokens[0].val == "#" || tokens[0].val == "//")
return true;
return false;
}
// Parse lines of serpent (helper function)
Node parseLines(std::vector<std::string> lines, Metadata metadata, int sp) {
std::vector<Node> o;
int origLine = metadata.ln;
unsigned i = 0;
while (i < lines.size()) {
metadata.ln = origLine + i;
std::string main = lines[i];
if (isLineEmpty(main)) {
i += 1;
continue;
}
int spaces = spaceCount(main);
if (spaces != sp) {
err("Indent mismatch", metadata);
}
// Tokenize current line
std::vector<Node> tokens = tokenize(main.substr(sp), metadata);
// Remove comments
std::vector<Node> tokens2;
for (unsigned j = 0; j < tokens.size(); j++) {
if (tokens[j].val == "#" || tokens[j].val == "//") break;
tokens2.push_back(tokens[j]);
}
bool expectingChildBlock = false;
if (tokens2.size() > 0 && tokens2.back().val == ":") {
tokens2.pop_back();
expectingChildBlock = true;
}
// Parse current line
Node out = parseSerpentTokenStream(tokens2);
// Parse child block
int childIndent = 999999;
std::vector<std::string> childBlock;
while (1) {
i++;
if (i >= lines.size())
break;
bool ile = isLineEmpty(lines[i]);
if (!ile) {
int spaces = spaceCount(lines[i]);
if (spaces <= sp) break;
childBlock.push_back(lines[i]);
if (spaces < childIndent) childIndent = spaces;
}
else childBlock.push_back("");
}
// Child block empty?
bool cbe = true;
for (unsigned i = 0; i < childBlock.size(); i++) {
if (childBlock[i].length() > 0) { cbe = false; break; }
}
// Add child block to AST
if (expectingChildBlock) {
if (cbe)
err("Expected indented child block!", out.metadata);
out.type = ASTNODE;
metadata.ln += 1;
out.args.push_back(parseLines(childBlock, metadata, childIndent));
metadata.ln -= 1;
}
else if (!cbe)
err("Did not expect indented child block!", out.metadata);
else if (out.args.size() && out.args[out.args.size() - 1].val == ":") {
Node n = out.args[out.args.size() - 1];
out.args.pop_back();
out.args.push_back(n.args[0]);
out.args.push_back(n.args[1]);
}
// Bring back if / elif into AST
if (bodied(tokens[0].val)) {
if (out.val != "multi") {
// token not being used in bodied form
}
else if (out.args[0].val == "id")
out = astnode(tokens[0].val, out.args[1].args, out.metadata);
else if (out.args[0].type == TOKEN) {
std::vector<Node> out2;
for (unsigned i = 1; i < out.args.size(); i++)
out2.push_back(out.args[i]);
out = astnode(tokens[0].val, out2, out.metadata);
}
else
out = astnode("fun", out.args, out.metadata);
}
// Multi not supported
if (out.val == "multi")
err("Multiple expressions or unclosed bracket", out.metadata);
// Convert top-level colon expressions into non-colon expressions;
// makes if statements and the like equivalent indented or not
//if (out.val == ":" && out.args[0].type == TOKEN)
// out = asn(out.args[0].val, out.args[1], out.metadata);
//if (bodied(tokens[0].val) && out.args[0].val == ":")
// out = asn(tokens[0].val, out.args[0].args);
if (o.size() == 0 || o.back().type == TOKEN) {
o.push_back(out);
continue;
}
// This is a little complicated. Basically, the idea here is to build
// constructions like [if [< x 5] [a] [elif [< x 10] [b] [else [c]]]]
std::vector<Node> u;
u.push_back(o.back());
if (bodiedContinued(o.back().val, out.val)) {
while (1) {
if (!bodiedContinued(u.back().val, out.val)) {
u.pop_back();
break;
}
if (!u.back().args.size()
|| !bodiedContinued(u.back().val, u.back().args.back().val)) {
break;
}
u.push_back(u.back().args.back());
}
u.back().args.push_back(out);
while (u.size() > 1) {
Node v = u.back();
u.pop_back();
u.back().args.pop_back();
u.back().args.push_back(v);
}
o.pop_back();
o.push_back(u[0]);
}
else o.push_back(out);
}
if (o.size() == 1)
return o[0];
else if (o.size())
return astnode("seq", o, o[0].metadata);
else
return astnode("seq", o, Metadata());
}
// Parses serpent code
Node parseSerpent(std::string s) {
std::string input = s;
std::string file = "main";
if (exists(s)) {
file = s;
input = get_file_contents(s);
}
return parseLines(splitLines(input), Metadata(file, 0, 0), 0);
}
using namespace std;

View File

@ -0,0 +1,13 @@
#ifndef ETHSERP_PARSER
#define ETHSERP_PARSER
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
// Serpent text -> parse tree
Node parseSerpent(std::string s);
#endif

View File

@ -0,0 +1,299 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "bignum.h"
#include "rewriteutils.h"
#include "optimize.h"
#include "preprocess.h"
#include "functions.h"
#include "opcodes.h"
// Convert a function of the form (def (f x y z) (do stuff)) into
// (if (first byte of ABI is correct) (seq (setup x y z) (do stuff)))
Node convFunction(Node node, int functionCount) {
std::string prefix = "_temp"+mkUniqueToken()+"_";
Metadata m = node.metadata;
if (node.args.size() != 2)
err("Malformed def!", m);
// Collect the list of variable names and variable byte counts
Node unpack = unpackArguments(node.args[0].args, m);
// And the actual code
Node body = node.args[1];
// Main LLL-based function body
return astnode("if",
astnode("eq",
astnode("get", token("__funid", m), m),
token(unsignedToDecimal(functionCount), m),
m),
astnode("seq", unpack, body, m));
}
// Populate an svObj with the arguments needed to determine
// the storage position of a node
svObj getStorageVars(svObj pre, Node node, std::string prefix,
int index) {
Metadata m = node.metadata;
if (!pre.globalOffset.size()) pre.globalOffset = "0";
std::vector<Node> h;
std::vector<std::string> coefficients;
// Array accesses or atoms
if (node.val == "access" || node.type == TOKEN) {
std::string tot = "1";
h = listfyStorageAccess(node);
coefficients.push_back("1");
for (unsigned i = h.size() - 1; i >= 1; i--) {
// Array sizes must be constant or at least arithmetically
// evaluable at compile time
if (!isPureArithmetic(h[i]))
err("Array size must be fixed value", m);
// Create a list of the coefficient associated with each
// array index
coefficients.push_back(decimalMul(coefficients.back(), h[i].val));
}
}
// Tuples
else {
int startc;
// Handle the (fun <fun_astnode> args...) case
if (node.val == "fun") {
startc = 1;
h = listfyStorageAccess(node.args[0]);
}
// Handle the (<fun_name> args...) case, which
// the serpent parser produces when the function
// is a simple name and not a complex astnode
else {
startc = 0;
h = listfyStorageAccess(token(node.val, m));
}
svObj sub = pre;
sub.globalOffset = "0";
// Evaluate tuple elements recursively
for (unsigned i = startc; i < node.args.size(); i++) {
sub = getStorageVars(sub,
node.args[i],
prefix+h[0].val.substr(2)+".",
i-startc);
}
coefficients.push_back(sub.globalOffset);
for (unsigned i = h.size() - 1; i >= 1; i--) {
// Array sizes must be constant or at least arithmetically
// evaluable at compile time
if (!isPureArithmetic(h[i]))
err("Array size must be fixed value", m);
// Create a list of the coefficient associated with each
// array index
coefficients.push_back(decimalMul(coefficients.back(), h[i].val));
}
pre.offsets = sub.offsets;
pre.coefficients = sub.coefficients;
pre.nonfinal = sub.nonfinal;
pre.nonfinal[prefix+h[0].val.substr(2)] = true;
}
pre.coefficients[prefix+h[0].val.substr(2)] = coefficients;
pre.offsets[prefix+h[0].val.substr(2)] = pre.globalOffset;
pre.indices[prefix+h[0].val.substr(2)] = index;
if (decimalGt(tt176, coefficients.back()))
pre.globalOffset = decimalAdd(pre.globalOffset, coefficients.back());
return pre;
}
// Preprocess input containing functions
//
// localExterns is a map of the form, eg,
//
// { x: { foo: 0, bar: 1, baz: 2 }, y: { qux: 0, foo: 1 } ... }
//
// localExternSigs is a map of the form, eg,
//
// { x : { foo: iii, bar: iis, baz: ia }, y: { qux: i, foo: as } ... }
//
// Signifying that x.foo = 0, x.baz = 2, y.foo = 1, etc
// and that x.foo has three integers as arguments, x.bar has two
// integers and a variable-length string, and baz has an integer
// and an array
//
// globalExterns is a one-level map, eg from above
//
// { foo: 1, bar: 1, baz: 2, qux: 0 }
//
// globalExternSigs is a one-level map, eg from above
//
// { foo: as, bar: iis, baz: ia, qux: i}
//
// Note that globalExterns and globalExternSigs may be ambiguous
// Also, a null signature implies an infinite tail of integers
preprocessResult preprocessInit(Node inp) {
Metadata m = inp.metadata;
if (inp.val != "seq")
inp = astnode("seq", inp, m);
std::vector<Node> empty = std::vector<Node>();
Node init = astnode("seq", empty, m);
Node shared = astnode("seq", empty, m);
std::vector<Node> any;
std::vector<Node> functions;
preprocessAux out = preprocessAux();
out.localExterns["self"] = std::map<std::string, int>();
int functionCount = 0;
int storageDataCount = 0;
for (unsigned i = 0; i < inp.args.size(); i++) {
Node obj = inp.args[i];
// Functions
if (obj.val == "def") {
if (obj.args.size() == 0)
err("Empty def", m);
std::string funName = obj.args[0].val;
// Init, shared and any are special functions
if (funName == "init" || funName == "shared" || funName == "any") {
if (obj.args[0].args.size())
err(funName+" cannot have arguments", m);
}
if (funName == "init") init = obj.args[1];
else if (funName == "shared") shared = obj.args[1];
else if (funName == "any") any.push_back(obj.args[1]);
else {
// Other functions
functions.push_back(convFunction(obj, functionCount));
out.localExterns["self"][obj.args[0].val] = functionCount;
out.localExternSigs["self"][obj.args[0].val]
= getSignature(obj.args[0].args);
functionCount++;
}
}
// Extern declarations
else if (obj.val == "extern") {
std::string externName = obj.args[0].val;
Node al = obj.args[1];
if (!out.localExterns.count(externName))
out.localExterns[externName] = std::map<std::string, int>();
for (unsigned i = 0; i < al.args.size(); i++) {
if (al.args[i].val == ":") {
std::string v = al.args[i].args[0].val;
std::string sig = al.args[i].args[1].val;
out.globalExterns[v] = i;
out.globalExternSigs[v] = sig;
out.localExterns[externName][v] = i;
out.localExternSigs[externName][v] = sig;
}
else {
std::string v = al.args[i].val;
out.globalExterns[v] = i;
out.globalExternSigs[v] = "";
out.localExterns[externName][v] = i;
out.localExternSigs[externName][v] = "";
}
}
}
// Custom macros
else if (obj.val == "macro") {
// Rules for valid macros:
//
// There are only four categories of valid macros:
//
// 1. a macro where the outer function is something
// which is NOT an existing valid function/extern/datum
// 2. a macro of the form set(c(x), d) where c must NOT
// be an existing valid function/extern/datum
// 3. something of the form access(c(x)), where c must NOT
// be an existing valid function/extern/datum
// 4. something of the form set(access(c(x)), d) where c must
// NOT be an existing valid function/extern/datum
bool valid = false;
Node pattern = obj.args[0];
Node substitution = obj.args[1];
if (opcode(pattern.val) < 0 && !isValidFunctionName(pattern.val))
valid = true;
if (pattern.val == "set" &&
opcode(pattern.args[0].val) < 0 &&
!isValidFunctionName(pattern.args[0].val))
valid = true;
if (pattern.val == "access" &&
opcode(pattern.args[0].val) < 0 &&
!isValidFunctionName(pattern.args[0].val))
if (pattern.val == "set" &&
pattern.args[0].val == "access" &&
opcode(pattern.args[0].args[0].val) < 0 &&
!isValidFunctionName(pattern.args[0].args[0].val))
valid = true;
if (valid) {
out.customMacros.push_back(rewriteRule(pattern, substitution));
}
}
// Variable types
else if (obj.val == "type") {
std::string typeName = obj.args[0].val;
std::vector<Node> vars = obj.args[1].args;
for (unsigned i = 0; i < vars.size(); i++)
out.types[vars[i].val] = typeName;
}
// Storage variables/structures
else if (obj.val == "data") {
out.storageVars = getStorageVars(out.storageVars,
obj.args[0],
"",
storageDataCount);
storageDataCount += 1;
}
else any.push_back(obj);
}
std::vector<Node> main;
if (shared.args.size()) main.push_back(shared);
if (init.args.size()) main.push_back(init);
std::vector<Node> code;
if (shared.args.size()) code.push_back(shared);
for (unsigned i = 0; i < any.size(); i++)
code.push_back(any[i]);
for (unsigned i = 0; i < functions.size(); i++)
code.push_back(functions[i]);
Node codeNode;
if (functions.size() > 0) {
codeNode = astnode("with",
token("__funid", m),
astnode("byte",
token("0", m),
astnode("calldataload", token("0", m), m),
m),
astnode("seq", code, m),
m);
}
else codeNode = astnode("seq", code, m);
main.push_back(astnode("~return",
token("0", m),
astnode("lll",
codeNode,
token("0", m),
m),
m));
Node result;
if (main.size() == 1) result = main[0];
else result = astnode("seq", main, inp.metadata);
return preprocessResult(result, out);
}
preprocessResult processTypes (preprocessResult pr) {
preprocessAux aux = pr.second;
Node node = pr.first;
if (node.type == TOKEN && aux.types.count(node.val)) {
node = asn(aux.types[node.val], node, node.metadata);
}
else if (node.val == "untyped")
return preprocessResult(node.args[0], aux);
else {
for (unsigned i = 0; i < node.args.size(); i++) {
node.args[i] =
processTypes(preprocessResult(node.args[i], aux)).first;
}
}
return preprocessResult(node, aux);
}
preprocessResult preprocess(Node n) {
return processTypes(preprocessInit(n));
}

View File

@ -0,0 +1,58 @@
#ifndef ETHSERP_PREPROCESSOR
#define ETHSERP_PREPROCESSOR
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
// Storage variable index storing object
struct svObj {
std::map<std::string, std::string> offsets;
std::map<std::string, int> indices;
std::map<std::string, std::vector<std::string> > coefficients;
std::map<std::string, bool> nonfinal;
std::string globalOffset;
};
class rewriteRule {
public:
rewriteRule(Node p, Node s) {
pattern = p;
substitution = s;
}
Node pattern;
Node substitution;
};
// Preprocessing result storing object
class preprocessAux {
public:
preprocessAux() {
globalExterns = std::map<std::string, int>();
localExterns = std::map<std::string, std::map<std::string, int> >();
localExterns["self"] = std::map<std::string, int>();
}
std::map<std::string, int> globalExterns;
std::map<std::string, std::string> globalExternSigs;
std::map<std::string, std::map<std::string, int> > localExterns;
std::map<std::string, std::map<std::string, std::string> > localExternSigs;
std::vector<rewriteRule> customMacros;
std::map<std::string, std::string> types;
svObj storageVars;
};
#define preprocessResult std::pair<Node, preprocessAux>
// Populate an svObj with the arguments needed to determine
// the storage position of a node
svObj getStorageVars(svObj pre, Node node, std::string prefix="",
int index=0);
// Preprocess a function (see cpp for details)
preprocessResult preprocess(Node inp);
#endif

View File

@ -0,0 +1,173 @@
#include <Python.h>
#include "structmember.h"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include "funcs.h"
#define PYMETHOD(name, FROM, method, TO) \
static PyObject * name(PyObject *, PyObject *args) { \
try { \
FROM(med) \
return TO(method(med)); \
} \
catch (std::string e) { \
PyErr_SetString(PyExc_Exception, e.c_str()); \
return NULL; \
} \
}
#define FROMSTR(v) \
const char *command; \
int len; \
if (!PyArg_ParseTuple(args, "s#", &command, &len)) \
return NULL; \
std::string v = std::string(command, len); \
#define FROMNODE(v) \
PyObject *node; \
if (!PyArg_ParseTuple(args, "O", &node)) \
return NULL; \
Node v = cppifyNode(node);
#define FROMLIST(v) \
PyObject *node; \
if (!PyArg_ParseTuple(args, "O", &node)) \
return NULL; \
std::vector<Node> v = cppifyNodeList(node);
// Convert metadata into python wrapper form [file, ln, ch]
PyObject* pyifyMetadata(Metadata m) {
PyObject* a = PyList_New(0);
PyList_Append(a, Py_BuildValue("s#", m.file.c_str(), m.file.length()));
PyList_Append(a, Py_BuildValue("i", m.ln));
PyList_Append(a, Py_BuildValue("i", m.ch));
return a;
}
// Convert node into python wrapper form
// [token=0/astnode=1, val, metadata, args]
PyObject* pyifyNode(Node n) {
PyObject* a = PyList_New(0);
PyList_Append(a, Py_BuildValue("i", n.type == ASTNODE));
PyList_Append(a, Py_BuildValue("s#", n.val.c_str(), n.val.length()));
PyList_Append(a, pyifyMetadata(n.metadata));
for (unsigned i = 0; i < n.args.size(); i++)
PyList_Append(a, pyifyNode(n.args[i]));
return a;
}
// Convert string into python wrapper form
PyObject* pyifyString(std::string s) {
return Py_BuildValue("s#", s.c_str(), s.length());
}
// Convert list of nodes into python wrapper form
PyObject* pyifyNodeList(std::vector<Node> n) {
PyObject* a = PyList_New(0);
for (unsigned i = 0; i < n.size(); i++)
PyList_Append(a, pyifyNode(n[i]));
return a;
}
// Convert pyobject int into normal form
int cppifyInt(PyObject* o) {
int out;
if (!PyArg_Parse(o, "i", &out))
err("Argument should be integer", Metadata());
return out;
}
// Convert pyobject string into normal form
std::string cppifyString(PyObject* o) {
const char *command;
if (!PyArg_Parse(o, "s", &command))
err("Argument should be string", Metadata());
return std::string(command);
}
// Convert metadata from python wrapper form
Metadata cppifyMetadata(PyObject* o) {
std::string file = cppifyString(PyList_GetItem(o, 0));
int ln = cppifyInt(PyList_GetItem(o, 1));
int ch = cppifyInt(PyList_GetItem(o, 2));
return Metadata(file, ln, ch);
}
// Convert node from python wrapper form
Node cppifyNode(PyObject* o) {
Node n;
int isAstNode = cppifyInt(PyList_GetItem(o, 0));
n.type = isAstNode ? ASTNODE : TOKEN;
n.val = cppifyString(PyList_GetItem(o, 1));
n.metadata = cppifyMetadata(PyList_GetItem(o, 2));
std::vector<Node> args;
for (int i = 3; i < PyList_Size(o); i++) {
args.push_back(cppifyNode(PyList_GetItem(o, i)));
}
n.args = args;
return n;
}
//Convert list of nodes into normal form
std::vector<Node> cppifyNodeList(PyObject* o) {
std::vector<Node> out;
for (int i = 0; i < PyList_Size(o); i++) {
out.push_back(cppifyNode(PyList_GetItem(o,i)));
}
return out;
}
PYMETHOD(ps_compile, FROMSTR, compile, pyifyString)
PYMETHOD(ps_compile_chunk, FROMSTR, compileChunk, pyifyString)
PYMETHOD(ps_compile_to_lll, FROMSTR, compileToLLL, pyifyNode)
PYMETHOD(ps_compile_chunk_to_lll, FROMSTR, compileChunkToLLL, pyifyNode)
PYMETHOD(ps_compile_lll, FROMNODE, compileLLL, pyifyString)
PYMETHOD(ps_parse, FROMSTR, parseSerpent, pyifyNode)
PYMETHOD(ps_rewrite, FROMNODE, rewrite, pyifyNode)
PYMETHOD(ps_rewrite_chunk, FROMNODE, rewriteChunk, pyifyNode)
PYMETHOD(ps_pretty_compile, FROMSTR, prettyCompile, pyifyNodeList)
PYMETHOD(ps_pretty_compile_chunk, FROMSTR, prettyCompileChunk, pyifyNodeList)
PYMETHOD(ps_pretty_compile_lll, FROMNODE, prettyCompileLLL, pyifyNodeList)
PYMETHOD(ps_serialize, FROMLIST, serialize, pyifyString)
PYMETHOD(ps_deserialize, FROMSTR, deserialize, pyifyNodeList)
PYMETHOD(ps_parse_lll, FROMSTR, parseLLL, pyifyNode)
static PyMethodDef PyextMethods[] = {
{"compile", ps_compile, METH_VARARGS,
"Compile code."},
{"compile_chunk", ps_compile_chunk, METH_VARARGS,
"Compile code chunk (no wrappers)."},
{"compile_to_lll", ps_compile_to_lll, METH_VARARGS,
"Compile code to LLL."},
{"compile_chunk_to_lll", ps_compile_chunk_to_lll, METH_VARARGS,
"Compile code chunk to LLL (no wrappers)."},
{"compile_lll", ps_compile_lll, METH_VARARGS,
"Compile LLL to EVM."},
{"parse", ps_parse, METH_VARARGS,
"Parse serpent"},
{"rewrite", ps_rewrite, METH_VARARGS,
"Rewrite parsed serpent to LLL"},
{"rewrite_chunk", ps_rewrite_chunk, METH_VARARGS,
"Rewrite parsed serpent to LLL (no wrappers)"},
{"pretty_compile", ps_pretty_compile, METH_VARARGS,
"Compile to EVM opcodes"},
{"pretty_compile_chunk", ps_pretty_compile_chunk, METH_VARARGS,
"Compile chunk to EVM opcodes (no wrappers)"},
{"pretty_compile_lll", ps_pretty_compile_lll, METH_VARARGS,
"Compile LLL to EVM opcodes"},
{"serialize", ps_serialize, METH_VARARGS,
"Convert EVM opcodes to bin"},
{"deserialize", ps_deserialize, METH_VARARGS,
"Convert EVM bin to opcodes"},
{"parse_lll", ps_parse_lll, METH_VARARGS,
"Parse LLL"},
{NULL, NULL, 0, NULL} /* Sentinel */
};
PyMODINIT_FUNC initserpent_pyext(void)
{
Py_InitModule( "serpent_pyext", PyextMethods );
}

View File

@ -0,0 +1 @@
from serpent import *

View File

@ -0,0 +1,804 @@
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
#include "lllparser.h"
#include "bignum.h"
#include "optimize.h"
#include "rewriteutils.h"
#include "preprocess.h"
#include "functions.h"
#include "opcodes.h"
// Rewrite rules
std::string macros[][2] = {
{
"(seq $x)",
"$x"
},
{
"(seq (seq) $x)",
"$x"
},
{
"(+= $a $b)",
"(set $a (+ $a $b))"
},
{
"(*= $a $b)",
"(set $a (* $a $b))"
},
{
"(-= $a $b)",
"(set $a (- $a $b))"
},
{
"(/= $a $b)",
"(set $a (/ $a $b))"
},
{
"(%= $a $b)",
"(set $a (% $a $b))"
},
{
"(^= $a $b)",
"(set $a (^ $a $b))"
},
{
"(!= $a $b)",
"(iszero (eq $a $b))"
},
{
"(assert $x)",
"(unless $x (stop))"
},
{
"(min $a $b)",
"(with $1 $a (with $2 $b (if (lt $1 $2) $1 $2)))"
},
{
"(max $a $b)",
"(with $1 $a (with $2 $b (if (lt $1 $2) $2 $1)))"
},
{
"(smin $a $b)",
"(with $1 $a (with $2 $b (if (slt $1 $2) $1 $2)))"
},
{
"(smax $a $b)",
"(with $1 $a (with $2 $b (if (slt $1 $2) $2 $1)))"
},
{
"(if $cond $do (else $else))",
"(if $cond $do $else)"
},
{
"(code $code)",
"$code"
},
{
"(slice $arr $pos)",
"(add $arr (mul 32 $pos))",
},
{
"(array $len)",
"(alloc (mul 32 $len))"
},
{
"(while $cond $do)",
"(until (iszero $cond) $do)",
},
{
"(while (iszero $cond) $do)",
"(until $cond $do)",
},
{
"(if $cond $do)",
"(unless (iszero $cond) $do)",
},
{
"(if (iszero $cond) $do)",
"(unless $cond $do)",
},
{
"(access (. self storage) $ind)",
"(sload $ind)"
},
{
"(access $var $ind)",
"(mload (add $var (mul 32 $ind)))"
},
{
"(set (access (. self storage) $ind) $val)",
"(sstore $ind $val)"
},
{
"(set (access $var $ind) $val)",
"(mstore (add $var (mul 32 $ind)) $val)"
},
{
"(getch $var $ind)",
"(mod (mload (sub (add $var $ind) 31)) 256)"
},
{
"(setch $var $ind $val)",
"(mstore8 (add $var $ind) $val)",
},
{
"(send $to $value)",
"(~call (sub (gas) 25) $to $value 0 0 0 0)"
},
{
"(send $gas $to $value)",
"(~call $gas $to $value 0 0 0 0)"
},
{
"(sha3 $x)",
"(seq (set $1 $x) (~sha3 (ref $1) 32))"
},
{
"(sha3 $mstart (= chars $msize))",
"(~sha3 $mstart $msize)"
},
{
"(sha3 $mstart $msize)",
"(~sha3 $mstart (mul 32 $msize))"
},
{
"(id $0)",
"$0"
},
{
"(return $x)",
"(seq (set $1 $x) (~return (ref $1) 32))"
},
{
"(return $mstart (= chars $msize))",
"(~return $mstart $msize)"
},
{
"(return $start $len)",
"(~return $start (mul 32 $len))"
},
{
"(&& $x $y)",
"(if $x $y 0)"
},
{
"(|| $x $y)",
"(with $1 $x (if $1 $1 $y))"
},
{
"(>= $x $y)",
"(iszero (slt $x $y))"
},
{
"(<= $x $y)",
"(iszero (sgt $x $y))"
},
{
"(create $code)",
"(create 0 $code)"
},
{
"(create $endowment $code)",
"(with $1 (msize) (create $endowment (get $1) (lll (outer $code) (msize))))"
},
{
"(sha256 $x)",
"(with $1 (alloc 64) (seq (mstore (add (get $1) 32) $x) (pop (~call 101 2 0 (add (get $1) 32) 32 (get $1) 32)) (mload (get $1))))"
},
{
"(sha256 $arr (= chars $sz))",
"(with $1 (alloc 32) (seq (pop (~call 101 2 0 $arr $sz (get $1) 32)) (mload (get $1))))"
},
{
"(sha256 $arr $sz)",
"(with $1 (alloc 32) (seq (pop (~call 101 2 0 $arr (mul 32 $sz) (get $1) 32)) (mload (get $1))))"
},
{
"(ripemd160 $x)",
"(with $1 (alloc 64) (seq (mstore (add (get $1) 32) $x) (pop (~call 101 3 0 (add (get $1) 32) 32 (get $1) 32)) (mload (get $1))))"
},
{
"(ripemd160 $arr (= chars $sz))",
"(with $1 (alloc 32) (seq (pop (~call 101 3 0 $arr $sz (mload $1) 32)) (mload (get $1))))"
},
{
"(ripemd160 $arr $sz)",
"(with $1 (alloc 32) (seq (pop (~call 101 3 0 $arr (mul 32 $sz) (get $1) 32)) (mload (get $1))))"
},
{
"(ecrecover $h $v $r $s)",
"(with $1 (alloc 160) (seq (mstore (get $1) $h) (mstore (add (get $1) 32) $v) (mstore (add (get $1) 64) $r) (mstore (add (get $1) 96) $s) (pop (~call 101 1 0 (get $1) 128 (add (get $1 128)) 32)) (mload (add (get $1) 128))))"
},
{
"(inset $x)",
"$x"
},
{
"(create $x)",
"(with $1 (msize) (create $val (get $1) (lll $code (get $1))))"
},
{
"(with (= $var $val) $cond)",
"(with $var $val $cond)"
},
{
"(log $t1)",
"(~log1 0 0 $t1)"
},
{
"(log $t1 $t2)",
"(~log2 0 0 $t1 $t2)"
},
{
"(log $t1 $t2 $t3)",
"(~log3 0 0 $t1 $t2 $t3)"
},
{
"(log $t1 $t2 $t3 $t4)",
"(~log4 0 0 $t1 $t2 $t3 $t4)"
},
{
"(logarr $a $sz)",
"(~log0 $a (mul 32 $sz))"
},
{
"(logarr $a $sz $t1)",
"(~log1 $a (mul 32 $sz) $t1)"
},
{
"(logarr $a $sz $t1 $t2)",
"(~log2 $a (mul 32 $sz) $t1 $t2)"
},
{
"(logarr $a $sz $t1 $t2 $t3)",
"(~log3 $a (mul 32 $sz) $t1 $t2 $t3)"
},
{
"(logarr $a $sz $t1 $t2 $t3 $t4)",
"(~log4 $a (mul 32 $sz) $t1 $t2 $t3 $t4)"
},
{
"(save $loc $array (= chars $count))",
"(with $location (ref $loc) (with $c $count (with $end (div $c 32) (with $i 0 (seq (while (slt $i $end) (seq (sstore (add $i $location) (access $array $i)) (set $i (add $i 1)))) (sstore (add $i $location) (~and (access $array $i) (sub 0 (exp 256 (sub 32 (mod $c 32)))))))))))"
},
{
"(save $loc $array $count)",
"(with $location (ref $loc) (with $end $count (with $i 0 (while (slt $i $end) (seq (sstore (add $i $location) (access $array $i)) (set $i (add $i 1)))))))"
},
{
"(load $loc (= chars $count))",
"(with $location (ref $loc) (with $c $count (with $a (alloc $c) (with $i 0 (seq (while (slt $i (div $c 32)) (seq (set (access $a $i) (sload (add $location $i))) (set $i (add $i 1)))) (set (access $a $i) (~and (sload (add $location $i)) (sub 0 (exp 256 (sub 32 (mod $c 32)))))) $a)))))"
},
{
"(load $loc $count)",
"(with $location (ref $loc) (with $c $count (with $a (alloc $c) (with $i 0 (seq (while (slt $i $c) (seq (set (access $a $i) (sload (add $location $i))) (set $i (add $i 1)))) $a)))))"
},
{
"(unsafe_mcopy $to $from $sz)",
"(with _sz $sz (with _from $from (with _to $to (seq (comment STARTING UNSAFE MCOPY) (with _i 0 (while (lt _i _sz) (seq (mstore (add $to _i) (mload (add _from _i))) (set _i (add _i 32)))))))))"
},
{
"(mcopy $to $from $_sz)",
"(with _to $to (with _from $from (with _sz $sz (seq (comment STARTING MCOPY (with _i 0 (seq (while (lt (add _i 31) _sz) (seq (mstore (add _to _i) (mload (add _from _i))) (set _i (add _i 32)))) (with _mask (exp 256 (sub 32 (mod _sz 32))) (mstore (add $to _i) (add (mod (mload (add $to _i)) _mask) (and (mload (add $from _i)) (sub 0 _mask))))))))))))"
},
{ "(. msg sender)", "(caller)" },
{ "(. msg value)", "(callvalue)" },
{ "(. tx gasprice)", "(gasprice)" },
{ "(. tx origin)", "(origin)" },
{ "(. tx gas)", "(gas)" },
{ "(. $x balance)", "(balance $x)" },
{ "self", "(address)" },
{ "(. block prevhash)", "(prevhash)" },
{ "(. block coinbase)", "(coinbase)" },
{ "(. block timestamp)", "(timestamp)" },
{ "(. block number)", "(number)" },
{ "(. block difficulty)", "(difficulty)" },
{ "(. block gaslimit)", "(gaslimit)" },
{ "stop", "(stop)" },
{ "---END---", "" } //Keep this line at the end of the list
};
std::vector<rewriteRule> nodeMacros;
// Token synonyms
std::string synonyms[][2] = {
{ "or", "||" },
{ "and", "&&" },
{ "|", "~or" },
{ "&", "~and" },
{ "elif", "if" },
{ "!", "iszero" },
{ "~", "~not" },
{ "not", "iszero" },
{ "string", "alloc" },
{ "+", "add" },
{ "-", "sub" },
{ "*", "mul" },
{ "/", "sdiv" },
{ "^", "exp" },
{ "**", "exp" },
{ "%", "smod" },
{ "<", "slt" },
{ ">", "sgt" },
{ "=", "set" },
{ "==", "eq" },
{ ":", "kv" },
{ "---END---", "" } //Keep this line at the end of the list
};
// Custom setters (need to be registered separately
// for use with managed storage)
std::string setters[][2] = {
{ "+=", "+" },
{ "-=", "-" },
{ "*=", "*" },
{ "/=", "/" },
{ "%=", "%" },
{ "^=", "^" },
{ "---END---", "" } //Keep this line at the end of the list
};
// Processes mutable array literals
Node array_lit_transform(Node node) {
std::string prefix = "_temp"+mkUniqueToken() + "_";
Metadata m = node.metadata;
std::map<std::string, Node> d;
std::string o = "(seq (set $arr (alloc "+utd(node.args.size()*32)+"))";
for (unsigned i = 0; i < node.args.size(); i++) {
o += " (mstore (add (get $arr) "+utd(i * 32)+") $"+utd(i)+")";
d[utd(i)] = node.args[i];
}
o += " (get $arr))";
return subst(parseLLL(o), d, prefix, m);
}
Node apply_rules(preprocessResult pr);
// Transform "<variable>.<fun>(args...)" into
// a call
Node dotTransform(Node node, preprocessAux aux) {
Metadata m = node.metadata;
// We're gonna make lots of temporary variables,
// so set up a unique flag for them
std::string prefix = "_temp"+mkUniqueToken()+"_";
// Check that the function name is a token
if (node.args[0].args[1].type == ASTNODE)
err("Function name must be static", m);
Node dotOwner = node.args[0].args[0];
std::string dotMember = node.args[0].args[1].val;
// kwargs = map of special arguments
std::map<std::string, Node> kwargs;
kwargs["value"] = token("0", m);
kwargs["gas"] = subst(parseLLL("(- (gas) 25)"), msn(), prefix, m);
// Search for as=? and call=code keywords, and isolate the actual
// function arguments
std::vector<Node> fnargs;
std::string as = "";
std::string op = "call";
for (unsigned i = 1; i < node.args.size(); i++) {
fnargs.push_back(node.args[i]);
Node arg = fnargs.back();
if (arg.val == "=" || arg.val == "set") {
if (arg.args[0].val == "as")
as = arg.args[1].val;
if (arg.args[0].val == "call" && arg.args[1].val == "code")
op = "callcode";
if (arg.args[0].val == "gas")
kwargs["gas"] = arg.args[1];
if (arg.args[0].val == "value")
kwargs["value"] = arg.args[1];
if (arg.args[0].val == "outsz")
kwargs["outsz"] = arg.args[1];
}
}
if (dotOwner.val == "self") {
if (as.size()) err("Cannot use \"as\" when calling self!", m);
as = dotOwner.val;
}
// Determine the funId and sig assuming the "as" keyword was used
int funId = 0;
std::string sig;
if (as.size() > 0 && aux.localExterns.count(as)) {
if (!aux.localExterns[as].count(dotMember))
err("Invalid call: "+printSimple(dotOwner)+"."+dotMember, m);
funId = aux.localExterns[as][dotMember];
sig = aux.localExternSigs[as][dotMember];
}
// Determine the funId and sig otherwise
else if (!as.size()) {
if (!aux.globalExterns.count(dotMember))
err("Invalid call: "+printSimple(dotOwner)+"."+dotMember, m);
std::string key = unsignedToDecimal(aux.globalExterns[dotMember]);
funId = aux.globalExterns[dotMember];
sig = aux.globalExternSigs[dotMember];
}
else err("Invalid call: "+printSimple(dotOwner)+"."+dotMember, m);
// Pack arguments
kwargs["data"] = packArguments(fnargs, sig, funId, m);
kwargs["to"] = dotOwner;
Node main;
// Pack output
if (!kwargs.count("outsz")) {
main = parseLLL(
"(with _data $data (seq "
"(pop (~"+op+" $gas $to $value (access _data 0) (access _data 1) (ref $dataout) 32))"
"(get $dataout)))");
}
else {
main = parseLLL(
"(with _data $data (with _outsz (mul 32 $outsz) (with _out (alloc _outsz) (seq "
"(pop (~"+op+" $gas $to $value (access _data 0) (access _data 1) _out _outsz))"
"(get _out)))))");
}
// Set up main call
Node o = subst(main, kwargs, prefix, m);
return o;
}
// Transform an access of the form self.bob, self.users[5], etc into
// a storage access
//
// There exist two types of objects: finite objects, and infinite
// objects. Finite objects are packed optimally tightly into storage
// accesses; for example:
//
// data obj[100](a, b[2][4], c)
//
// obj[0].a -> 0
// obj[0].b[0][0] -> 1
// obj[0].b[1][3] -> 8
// obj[45].c -> 459
//
// Infinite objects are accessed by sha3([v1, v2, v3 ... ]), where
// the values are a list of array indices and keyword indices, for
// example:
// data obj[](a, b[2][4], c)
// data obj2[](a, b[][], c)
//
// obj[0].a -> sha3([0, 0, 0])
// obj[5].b[1][3] -> sha3([0, 5, 1, 1, 3])
// obj[45].c -> sha3([0, 45, 2])
// obj2[0].a -> sha3([1, 0, 0])
// obj2[5].b[1][3] -> sha3([1, 5, 1, 1, 3])
// obj2[45].c -> sha3([1, 45, 2])
Node storageTransform(Node node, preprocessAux aux,
bool mapstyle=false, bool ref=false) {
Metadata m = node.metadata;
// Get a list of all of the "access parameters" used in order
// eg. self.users[5].cow[4][m[2]][woof] ->
// [--self, --users, 5, --cow, 4, m[2], woof]
std::vector<Node> hlist = listfyStorageAccess(node);
// For infinite arrays, the terms array will just provide a list
// of indices. For finite arrays, it's a list of index*coefficient
std::vector<Node> terms;
std::string offset = "0";
std::string prefix = "";
std::string varPrefix = "_temp"+mkUniqueToken()+"_";
int c = 0;
std::vector<std::string> coefficients;
coefficients.push_back("");
for (unsigned i = 1; i < hlist.size(); i++) {
// We pre-add the -- flag to parameter-like terms. For example,
// self.users[m] -> [--self, --users, m]
// self.users.m -> [--self, --users, --m]
if (hlist[i].val.substr(0, 2) == "--") {
prefix += hlist[i].val.substr(2) + ".";
std::string tempPrefix = prefix.substr(0, prefix.size()-1);
if (!aux.storageVars.offsets.count(tempPrefix))
return node;
if (c < (signed)coefficients.size() - 1)
err("Too few array index lookups", m);
if (c > (signed)coefficients.size() - 1)
err("Too many array index lookups", m);
coefficients = aux.storageVars.coefficients[tempPrefix];
// If the size of an object exceeds 2^176, we make it an infinite
// array
if (decimalGt(coefficients.back(), tt176) && !mapstyle)
return storageTransform(node, aux, true, ref);
offset = decimalAdd(offset, aux.storageVars.offsets[tempPrefix]);
c = 0;
if (mapstyle)
terms.push_back(token(unsignedToDecimal(
aux.storageVars.indices[tempPrefix])));
}
else if (mapstyle) {
terms.push_back(hlist[i]);
c += 1;
}
else {
if (c > (signed)coefficients.size() - 2)
err("Too many array index lookups", m);
terms.push_back(
astnode("mul",
hlist[i],
token(coefficients[coefficients.size() - 2 - c], m),
m));
c += 1;
}
}
if (aux.storageVars.nonfinal.count(prefix.substr(0, prefix.size()-1)))
err("Storage variable access not deep enough", m);
if (c < (signed)coefficients.size() - 1) {
err("Too few array index lookups", m);
}
if (c > (signed)coefficients.size() - 1) {
err("Too many array index lookups", m);
}
Node o;
if (mapstyle) {
std::string t = "_temp_"+mkUniqueToken();
std::vector<Node> sub;
for (unsigned i = 0; i < terms.size(); i++)
sub.push_back(asn("mstore",
asn("add",
tkn(utd(i * 32), m),
asn("get", tkn(t+"pos", m), m),
m),
terms[i],
m));
sub.push_back(tkn(t+"pos", m));
Node main = asn("with",
tkn(t+"pos", m),
asn("alloc", tkn(utd(terms.size() * 32), m), m),
asn("seq", sub, m),
m);
Node sz = token(utd(terms.size() * 32), m);
o = astnode("~sha3",
main,
sz,
m);
}
else {
// We add up all the index*coefficients
Node out = token(offset, node.metadata);
for (unsigned i = 0; i < terms.size(); i++) {
std::vector<Node> temp;
temp.push_back(out);
temp.push_back(terms[i]);
out = astnode("add", temp, node.metadata);
}
o = out;
}
if (ref) return o;
else return astnode("sload", o, node.metadata);
}
// Recursively applies rewrite rules
std::pair<Node, bool> apply_rules_iter(preprocessResult pr) {
bool changed = false;
Node node = pr.first;
// If the rewrite rules have not yet been parsed, parse them
if (!nodeMacros.size()) {
for (int i = 0; i < 9999; i++) {
std::vector<Node> o;
if (macros[i][0] == "---END---") break;
nodeMacros.push_back(rewriteRule(
parseLLL(macros[i][0]),
parseLLL(macros[i][1])
));
}
}
// Assignment transformations
for (int i = 0; i < 9999; i++) {
if (setters[i][0] == "---END---") break;
if (node.val == setters[i][0]) {
node = astnode("=",
node.args[0],
astnode(setters[i][1],
node.args[0],
node.args[1],
node.metadata),
node.metadata);
}
}
// Do nothing to macros
if (node.val == "macro") {
return std::pair<Node, bool>(node, changed);
}
// Ignore comments
if (node.val == "comment") {
return std::pair<Node, bool>(node, changed);
}
// Special storage transformation
if (isNodeStorageVariable(node)) {
node = storageTransform(node, pr.second);
changed = true;
}
if (node.val == "ref" && isNodeStorageVariable(node.args[0])) {
node = storageTransform(node.args[0], pr.second, false, true);
changed = true;
}
if (node.val == "=" && isNodeStorageVariable(node.args[0])) {
Node t = storageTransform(node.args[0], pr.second);
if (t.val == "sload") {
std::vector<Node> o;
o.push_back(t.args[0]);
o.push_back(node.args[1]);
node = astnode("sstore", o, node.metadata);
}
changed = true;
}
// Main code
unsigned pos = 0;
std::string prefix = "_temp"+mkUniqueToken()+"_";
while(1) {
if (synonyms[pos][0] == "---END---") {
break;
}
else if (node.type == ASTNODE && node.val == synonyms[pos][0]) {
node.val = synonyms[pos][1];
changed = true;
}
pos++;
}
for (pos = 0; pos < nodeMacros.size() + pr.second.customMacros.size(); pos++) {
rewriteRule macro = pos < nodeMacros.size()
? nodeMacros[pos]
: pr.second.customMacros[pos - nodeMacros.size()];
matchResult mr = match(macro.pattern, node);
if (mr.success) {
node = subst(macro.substitution, mr.map, prefix, node.metadata);
std::pair<Node, bool> o =
apply_rules_iter(preprocessResult(node, pr.second));
o.second = true;
return o;
}
}
// Special transformations
if (node.val == "outer") {
node = apply_rules(preprocess(node.args[0]));
changed = true;
}
if (node.val == "array_lit") {
node = array_lit_transform(node);
changed = true;
}
if (node.val == "fun" && node.args[0].val == ".") {
node = dotTransform(node, pr.second);
changed = true;
}
if (node.type == ASTNODE) {
unsigned i = 0;
if (node.val == "set" || node.val == "ref"
|| node.val == "get" || node.val == "with") {
if (node.args[0].val.size() > 0 && node.args[0].val[0] != '\''
&& node.args[0].type == TOKEN && node.args[0].val[0] != '$') {
node.args[0].val = "'" + node.args[0].val;
changed = true;
}
i = 1;
}
else if (node.val == "arglen") {
node.val = "get";
node.args[0].val = "'_len_" + node.args[0].val;
i = 1;
changed = true;
}
for (; i < node.args.size(); i++) {
std::pair<Node, bool> r =
apply_rules_iter(preprocessResult(node.args[i], pr.second));
node.args[i] = r.first;
changed = changed || r.second;
}
}
else if (node.type == TOKEN && !isNumberLike(node)) {
if (node.val.size() >= 2
&& node.val[0] == '"'
&& node.val[node.val.size() - 1] == '"') {
std::string bin = node.val.substr(1, node.val.size() - 2);
unsigned sz = bin.size();
std::vector<Node> o;
for (unsigned i = 0; i < sz; i += 32) {
std::string t = binToNumeric(bin.substr(i, 32));
if ((sz - i) < 32 && (sz - i) > 0) {
while ((sz - i) < 32) {
t = decimalMul(t, "256");
i--;
}
i = sz;
}
o.push_back(token(t, node.metadata));
}
node = astnode("array_lit", o, node.metadata);
std::pair<Node, bool> r =
apply_rules_iter(preprocessResult(node, pr.second));
node = r.first;
changed = true;
}
else if (node.val.size() && node.val[0] != '\'' && node.val[0] != '$') {
node.val = "'" + node.val;
std::vector<Node> args;
args.push_back(node);
std::string v = node.val.substr(1);
node = astnode("get", args, node.metadata);
changed = true;
}
}
return std::pair<Node, bool>(node, changed);
}
Node apply_rules(preprocessResult pr) {
for (unsigned i = 0; i < pr.second.customMacros.size(); i++) {
pr.second.customMacros[i].pattern =
apply_rules(preprocessResult(pr.second.customMacros[i].pattern, preprocessAux()));
}
while (1) {
//std::cerr << printAST(pr.first) <<
// " " << pr.second.customMacros.size() << "\n";
std::pair<Node, bool> r = apply_rules_iter(pr);
if (!r.second) {
return r.first;
}
pr.first = r.first;
}
}
Node validate(Node inp) {
Metadata m = inp.metadata;
if (inp.type == ASTNODE) {
int i = 0;
while(validFunctions[i][0] != "---END---") {
if (inp.val == validFunctions[i][0]) {
std::string sz = unsignedToDecimal(inp.args.size());
if (decimalGt(validFunctions[i][1], sz)) {
err("Too few arguments for "+inp.val, inp.metadata);
}
if (decimalGt(sz, validFunctions[i][2])) {
err("Too many arguments for "+inp.val, inp.metadata);
}
}
i++;
}
}
for (unsigned i = 0; i < inp.args.size(); i++) validate(inp.args[i]);
return inp;
}
Node postValidate(Node inp) {
// This allows people to use ~x as a way of having functions with the same
// name and arity as macros; the idea is that ~x is a "final" form, and
// should not be remacroed, but it is converted back at the end
if (inp.val.size() > 0 && inp.val[0] == '~') {
inp.val = inp.val.substr(1);
}
if (inp.type == ASTNODE) {
if (inp.val == ".")
err("Invalid object member (ie. a foo.bar not mapped to anything)",
inp.metadata);
else if (opcode(inp.val) >= 0) {
if ((signed)inp.args.size() < opinputs(inp.val))
err("Too few arguments for "+inp.val, inp.metadata);
if ((signed)inp.args.size() > opinputs(inp.val))
err("Too many arguments for "+inp.val, inp.metadata);
}
else if (isValidLLLFunc(inp.val, inp.args.size())) {
// do nothing
}
else err ("Invalid argument count or LLL function: "+inp.val, inp.metadata);
for (unsigned i = 0; i < inp.args.size(); i++) {
inp.args[i] = postValidate(inp.args[i]);
}
}
return inp;
}
Node rewrite(Node inp) {
return postValidate(optimize(apply_rules(preprocess(inp))));
}
Node rewriteChunk(Node inp) {
return postValidate(optimize(apply_rules(
preprocessResult(
validate(inp), preprocessAux()))));
}
using namespace std;

View File

@ -0,0 +1,16 @@
#ifndef ETHSERP_REWRITER
#define ETHSERP_REWRITER
#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include "util.h"
// Applies rewrite rules
Node rewrite(Node inp);
// Applies rewrite rules adding without wrapper
Node rewriteChunk(Node inp);
#endif

Some files were not shown because too many files have changed in this diff Show More