From fc29566ee5675e9cacc40fc48a1254ceca0194fb Mon Sep 17 00:00:00 2001 From: Silas Davis <silas@erisindustries.com> Date: Fri, 4 Aug 2017 16:36:01 +0100 Subject: [PATCH] port changes from master --- CHANGELOG.md | 21 +++++++++++++++++++ Makefile | 5 +++++ README.md | 2 +- logging/config/config.go | 2 +- logging/types/info_trace_logger.go | 1 - manager/burrow-mint/state/block_cache_test.go | 8 +++---- manager/burrow-mint/transactor.go | 16 +++++++++++--- 7 files changed, 45 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b33fa616..03577760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,25 @@ # burrow changelog +## v0.16.3 +This release adds an stop-gap fix to the `Transact` method so that it never +transfers value with the `CallTx` is generates. + +We hard-code `amount = fee` so that no value is transferred +regardless of fee sent. This fixes an invalid jump destination error arising +from transferring value to non-payable functions with newer versions of solidity. +By doing this we can resolve some issues with users of the v0 RPC without making +a breaking API change. + +## v0.16.2 +This release finalises our accession to the Hyperledger project and updates our +root package namespace to github.com/hyperledger/burrow. + +It also includes a bug fix for rpc/V0 so that BroadcastTx can accept any +transaction type and various pieces of internal clean-up. + +## v0.16.1 +This release was an internal rename to 'Burrow' with some minor other attendant +clean up. + ## v0.16.0 This is a consolidation release that fixes various bugs and improves elements of the architecture across the Monax Platform to support a quicker release diff --git a/Makefile b/Makefile index ed6c3e2b..7a413ab8 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,11 @@ check: @gofmt -l -d ${GOFILES_NOVENDOR} @gofmt -l ${GOFILES_NOVENDOR} | read && echo && echo "Your marmot has found a problem with the formatting style of the code." 1>&2 && exit 1 || true +# Just fix it +.PHONY: fix +fix: + @goimports -l -w ${GOFILES_NOVENDOR} + # fmt runs gofmt -w on the code, modifying any files that do not match # the style guide. .PHONY: fmt diff --git a/README.md b/README.md index 34f80866..c6d75acc 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ For a Vagrant file see [monax-vagrant](https://github.com/monax/monax-vagrant) f ## Usage -Once the server has started, it will begin syncing up with the network. At that point you may begin using it. The preferred way is through our [javascript api](https://github.com/hyperledger/burrow.js), but it is possible to connect directly via HTTP or websocket. +Once the server has started, it will begin syncing up with the network. At that point you may begin using it. The preferred way is through our [javascript api](https://github.com/monax/legacy-contracts.js), but it is possible to connect directly via HTTP or websocket. ## Configuration diff --git a/logging/config/config.go b/logging/config/config.go index 81b8b841..f620f816 100644 --- a/logging/config/config.go +++ b/logging/config/config.go @@ -10,7 +10,7 @@ import ( ) type LoggingConfig struct { - RootSink *SinkConfig `toml:"root_sink,omitempty"` + RootSink *SinkConfig `toml:"root_sink,omitempty"` } // For encoding a top-level '[logging]' TOML table diff --git a/logging/types/info_trace_logger.go b/logging/types/info_trace_logger.go index 63ac057b..613cf07c 100644 --- a/logging/types/info_trace_logger.go +++ b/logging/types/info_trace_logger.go @@ -52,7 +52,6 @@ type InfoTraceLogger interface { // Hot swap the underlying outputLogger with another one to re-route messages SwapOutput(outputLogger kitlog.Logger) - } // Interface assertions diff --git a/manager/burrow-mint/state/block_cache_test.go b/manager/burrow-mint/state/block_cache_test.go index f3bef027..03f99b49 100644 --- a/manager/burrow-mint/state/block_cache_test.go +++ b/manager/burrow-mint/state/block_cache_test.go @@ -21,8 +21,8 @@ func TestBlockCache_Sync_Accounts(t *testing.T) { // to remove them twice from merkle tree defer func() { if r := recover(); r != nil { - t.Fatalf("Consecutive calls to BlockCache.Sync() failed. " + - "Is cache dirty?\n Error: %s", r) + t.Fatalf("Consecutive calls to BlockCache.Sync() failed. "+ + "Is cache dirty?\n Error: %s", r) } }() blockCache.Sync() @@ -46,8 +46,8 @@ func TestBlockCache_Sync_NameReg(t *testing.T) { blockCache.Sync() defer func() { if r := recover(); r != nil { - t.Fatalf("Consecutive calls to BlockCache.Sync() failed. " + - "Is cache dirty?\n Error: %s", r) + t.Fatalf("Consecutive calls to BlockCache.Sync() failed. "+ + "Is cache dirty?\n Error: %s", r) } }() blockCache.Sync() diff --git a/manager/burrow-mint/transactor.go b/manager/burrow-mint/transactor.go index 3f73737b..799d97d4 100644 --- a/manager/burrow-mint/transactor.go +++ b/manager/burrow-mint/transactor.go @@ -23,7 +23,7 @@ import ( "github.com/hyperledger/burrow/account" core_types "github.com/hyperledger/burrow/core/types" - event "github.com/hyperledger/burrow/event" + "github.com/hyperledger/burrow/event" "github.com/hyperledger/burrow/manager/burrow-mint/evm" "github.com/hyperledger/burrow/manager/burrow-mint/state" "github.com/hyperledger/burrow/txs" @@ -178,10 +178,20 @@ func (this *transactor) Transact(privKey, address, data []byte, gasLimit, } else { sequence = acc.Sequence + 1 } - // fmt.Printf("Sequence %d\n", sequence) + // TODO: [Silas] we should consider revising this method and removing fee, or + // possibly adding an amount parameter. It is non-sensical to just be able to + // set the fee. Our support of fees in general is questionable since at the + // moment all we do is deduct the fee effectively leaking token. It is possible + // someone may be using the sending of native token to payable functions but + // they can be served by broadcasting a token. + + // We hard-code the amount to be equal to the fee which means the CallTx we + // generate transfers 0 value, which is the most sensible default since in + // recent solidity compilers the EVM generated will throw an error if value + // is transferred to a non-payable function. txInput := &txs.TxInput{ Address: pa.Address, - Amount: 1, + Amount: fee, Sequence: sequence, PubKey: pa.PubKey, } -- GitLab