aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Godeps/Godeps.json4
-rwxr-xr-x[-rw-r--r--]Godeps/_workspace/src/github.com/ethereum/ethash/setup.py0
-rw-r--r--Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/endian.h29
-rw-r--r--Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/internal.c2
-rw-r--r--README.md2
-rw-r--r--accounts/abi/numbers.go12
-rw-r--r--accounts/abi/numbers_test.go42
-rw-r--r--cmd/evm/main.go45
-rw-r--r--cmd/utils/cmd.go10
-rw-r--r--core/block_validator.go6
-rw-r--r--core/state/statedb.go21
-rw-r--r--eth/api.go1
-rw-r--r--rpc/doc.go2
-rw-r--r--rpc/server.go6
14 files changed, 119 insertions, 63 deletions
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 36104b456..9b5b9a44f 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -20,8 +20,8 @@
},
{
"ImportPath": "github.com/ethereum/ethash",
- "Comment": "v23.1-245-g25b32de",
- "Rev": "25b32de0c0271065c28c3719c2bfe86959d72f0c"
+ "Comment": "v23.1-247-g2e80de5",
+ "Rev": "2e80de5022370cfe632195b1720db52d07ff8a77"
},
{
"ImportPath": "github.com/fatih/color",
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/setup.py b/Godeps/_workspace/src/github.com/ethereum/ethash/setup.py
index 18aa20f6d..18aa20f6d 100644..100755
--- a/Godeps/_workspace/src/github.com/ethereum/ethash/setup.py
+++ b/Godeps/_workspace/src/github.com/ethereum/ethash/setup.py
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/endian.h b/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/endian.h
index 849325a59..5b8abf03d 100644
--- a/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/endian.h
+++ b/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/endian.h
@@ -19,7 +19,7 @@
# define BYTE_ORDER LITTLE_ENDIAN
#elif defined( __QNXNTO__ ) && defined( __BIGENDIAN__ )
# define BIG_ENDIAN 1234
- # define BYTE_ORDER BIG_ENDIAN
+ # define BYTE_ORDER BIG_ENDIAN
#else
# include <endian.h>
#endif
@@ -59,21 +59,20 @@
#define fix_endian32(dst_, src_) dst_ = ethash_swap_u32(src_)
#define fix_endian32_same(val_) val_ = ethash_swap_u32(val_)
-#define fix_endian64(dst_, src_) dst_ = ethash_swap_u64(src_
+#define fix_endian64(dst_, src_) dst_ = ethash_swap_u64(src_)
#define fix_endian64_same(val_) val_ = ethash_swap_u64(val_)
-#define fix_endian_arr32(arr_, size_) \
- do { \
- for (unsigned i_ = 0; i_ < (size_), ++i_) { \
- arr_[i_] = ethash_swap_u32(arr_[i_]); \
- } \
- while (0)
-#define fix_endian_arr64(arr_, size_) \
- do { \
- for (unsigned i_ = 0; i_ < (size_), ++i_) { \
- arr_[i_] = ethash_swap_u64(arr_[i_]); \
- } \
- while (0) \
-
+#define fix_endian_arr32(arr_, size_) \
+ do { \
+ for (unsigned i_ = 0; i_ < (size_); ++i_) { \
+ arr_[i_] = ethash_swap_u32(arr_[i_]); \
+ } \
+ } while (0)
+#define fix_endian_arr64(arr_, size_) \
+ do { \
+ for (unsigned i_ = 0; i_ < (size_); ++i_) { \
+ arr_[i_] = ethash_swap_u64(arr_[i_]); \
+ } \
+ } while (0)
#else
# error "endian not supported"
#endif // BYTE_ORDER
diff --git a/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/internal.c b/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/internal.c
index 338aa5ecd..0a830fc82 100644
--- a/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/internal.c
+++ b/Godeps/_workspace/src/github.com/ethereum/ethash/src/libethash/internal.c
@@ -257,7 +257,7 @@ static bool ethash_hash(
void ethash_quick_hash(
ethash_h256_t* return_hash,
ethash_h256_t const* header_hash,
- uint64_t const nonce,
+ uint64_t nonce,
ethash_h256_t const* mix_hash
)
{
diff --git a/README.md b/README.md
index 1dcfbf97f..95c7a3615 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@ The go-ethereum project comes with several wrappers/executables found in the `cm
| Command | Description |
|:----------:|-------------|
-| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default) archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as an gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. Please see our [Command Line Options](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) wiki page for details. |
+| **`geth`** | Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default) archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. Please see our [Command Line Options](https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options) wiki page for details. |
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) with expanded functionality if the contract bytecode is also available. However it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://github.com/ethereum/go-ethereum/wiki/Native-DApps:-Go-bindings-to-Ethereum-contracts) wiki page for details. |
| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
| `disasm` | Bytecode disassembler to convert EVM (Ethereum Virtual Machine) bytecode into more user friendly assembly-like opcodes (e.g. `echo "6001" | disasm`). For details on the individual opcodes, please see pages 22-30 of the [Ethereum Yellow Paper](http://gavwood.com/paper.pdf). |
diff --git a/accounts/abi/numbers.go b/accounts/abi/numbers.go
index 06c4422f9..3d5842292 100644
--- a/accounts/abi/numbers.go
+++ b/accounts/abi/numbers.go
@@ -56,27 +56,21 @@ var (
big_ts = reflect.TypeOf([]*big.Int(nil))
)
-// U256 will ensure unsigned 256bit on big nums
+// U256 converts a big Int into a 256bit EVM number.
func U256(n *big.Int) []byte {
return common.LeftPadBytes(common.U256(n).Bytes(), 32)
}
-// S256 will ensure signed 256bit on big nums
-func U2U256(n uint64) []byte {
- return U256(big.NewInt(int64(n)))
-}
-
// packNum packs the given number (using the reflect value) and will cast it to appropriate number representation
func packNum(value reflect.Value) []byte {
switch kind := value.Kind(); kind {
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
- return U2U256(value.Uint())
+ return U256(new(big.Int).SetUint64(value.Uint()))
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return U2U256(uint64(value.Int()))
+ return U256(big.NewInt(value.Int()))
case reflect.Ptr:
return U256(value.Interface().(*big.Int))
}
-
return nil
}
diff --git a/accounts/abi/numbers_test.go b/accounts/abi/numbers_test.go
index f409aa60f..44afe8647 100644
--- a/accounts/abi/numbers_test.go
+++ b/accounts/abi/numbers_test.go
@@ -18,6 +18,7 @@ package abi
import (
"bytes"
+ "math"
"math/big"
"reflect"
"testing"
@@ -34,21 +35,38 @@ func TestNumberTypes(t *testing.T) {
}
func TestPackNumber(t *testing.T) {
- ubytes := make([]byte, 32)
- ubytes[31] = 1
- maxunsigned := []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}
+ tests := []struct {
+ value reflect.Value
+ packed []byte
+ }{
+ // Protocol limits
+ {reflect.ValueOf(0), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
+ {reflect.ValueOf(1), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}},
+ {reflect.ValueOf(-1), []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}},
+
+ // Type corner cases
+ {reflect.ValueOf(uint8(math.MaxUint8)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255}},
+ {reflect.ValueOf(uint16(math.MaxUint16)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255}},
+ {reflect.ValueOf(uint32(math.MaxUint32)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255}},
+ {reflect.ValueOf(uint64(math.MaxUint64)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255}},
- packed := packNum(reflect.ValueOf(1))
- if !bytes.Equal(packed, ubytes) {
- t.Errorf("expected %x got %x", ubytes, packed)
+ {reflect.ValueOf(int8(math.MaxInt8)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127}},
+ {reflect.ValueOf(int16(math.MaxInt16)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255}},
+ {reflect.ValueOf(int32(math.MaxInt32)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 255, 255}},
+ {reflect.ValueOf(int64(math.MaxInt64)), []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 255, 255, 255, 255, 255, 255, 255}},
+
+ {reflect.ValueOf(int8(math.MinInt8)), []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, 128}},
+ {reflect.ValueOf(int16(math.MinInt16)), []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, 128, 0}},
+ {reflect.ValueOf(int32(math.MinInt32)), []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, 128, 0, 0, 0}},
+ {reflect.ValueOf(int64(math.MinInt64)), []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, 128, 0, 0, 0, 0, 0, 0, 0}},
}
- packed = packNum(reflect.ValueOf(-1))
- if !bytes.Equal(packed, maxunsigned) {
- t.Errorf("expected %x got %x", maxunsigned, packed)
+ for i, tt := range tests {
+ packed := packNum(tt.value)
+ if !bytes.Equal(packed, tt.packed) {
+ t.Errorf("test %d: pack mismatch: have %x, want %x", i, packed, tt.packed)
+ }
}
-
- packed = packNum(reflect.ValueOf("string"))
- if packed != nil {
+ if packed := packNum(reflect.ValueOf("string")); packed != nil {
t.Errorf("expected 'string' to pack to nil. got %x instead", packed)
}
}
diff --git a/cmd/evm/main.go b/cmd/evm/main.go
index e7b266d4e..aa48f6ede 100644
--- a/cmd/evm/main.go
+++ b/cmd/evm/main.go
@@ -84,11 +84,16 @@ var (
Name: "verbosity",
Usage: "sets the verbosity level",
}
+ CreateFlag = cli.BoolFlag{
+ Name: "create",
+ Usage: "indicates the action should be create rather than call",
+ }
)
func init() {
app = utils.NewApp("0.2", "the evm command line interface")
app.Flags = []cli.Flag{
+ CreateFlag,
DebugFlag,
VerbosityFlag,
ForceJitFlag,
@@ -111,8 +116,6 @@ func run(ctx *cli.Context) error {
db, _ := ethdb.NewMemDatabase()
statedb, _ := state.New(common.Hash{}, db)
sender := statedb.CreateAccount(common.StringToAddress("sender"))
- receiver := statedb.CreateAccount(common.StringToAddress("receiver"))
- receiver.SetCode(common.Hex2Bytes(ctx.GlobalString(CodeFlag.Name)))
vmenv := NewEnv(statedb, common.StringToAddress("evmuser"), common.Big(ctx.GlobalString(ValueFlag.Name)), vm.Config{
Debug: ctx.GlobalBool(DebugFlag.Name),
@@ -121,17 +124,37 @@ func run(ctx *cli.Context) error {
})
tstart := time.Now()
- ret, e := vmenv.Call(
- sender,
- receiver.Address(),
- common.Hex2Bytes(ctx.GlobalString(InputFlag.Name)),
- common.Big(ctx.GlobalString(GasFlag.Name)),
- common.Big(ctx.GlobalString(PriceFlag.Name)),
- common.Big(ctx.GlobalString(ValueFlag.Name)),
+
+ var (
+ ret []byte
+ err error
)
+
+ if ctx.GlobalBool(CreateFlag.Name) {
+ input := append(common.Hex2Bytes(ctx.GlobalString(CodeFlag.Name)), common.Hex2Bytes(ctx.GlobalString(InputFlag.Name))...)
+ ret, _, err = vmenv.Create(
+ sender,
+ input,
+ common.Big(ctx.GlobalString(GasFlag.Name)),
+ common.Big(ctx.GlobalString(PriceFlag.Name)),
+ common.Big(ctx.GlobalString(ValueFlag.Name)),
+ )
+ } else {
+ receiver := statedb.CreateAccount(common.StringToAddress("receiver"))
+ receiver.SetCode(common.Hex2Bytes(ctx.GlobalString(CodeFlag.Name)))
+ ret, err = vmenv.Call(
+ sender,
+ receiver.Address(),
+ common.Hex2Bytes(ctx.GlobalString(InputFlag.Name)),
+ common.Big(ctx.GlobalString(GasFlag.Name)),
+ common.Big(ctx.GlobalString(PriceFlag.Name)),
+ common.Big(ctx.GlobalString(ValueFlag.Name)),
+ )
+ }
vmdone := time.Since(tstart)
if ctx.GlobalBool(DumpFlag.Name) {
+ statedb.Commit()
fmt.Println(string(statedb.Dump()))
}
vm.StdErrFormat(vmenv.StructLogs())
@@ -150,8 +173,8 @@ num gc: %d
}
fmt.Printf("OUT: 0x%x", ret)
- if e != nil {
- fmt.Printf(" error: %v", e)
+ if err != nil {
+ fmt.Printf(" error: %v", err)
}
fmt.Println()
return nil
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index 9e2b14f56..3b521a0e1 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -120,7 +120,7 @@ func ImportChain(chain *core.BlockChain, fn string) error {
}
}
- glog.Infoln("Importing blockchain", fn)
+ glog.Infoln("Importing blockchain ", fn)
fh, err := os.Open(fn)
if err != nil {
return err
@@ -182,7 +182,7 @@ func hasAllBlocks(chain *core.BlockChain, bs []*types.Block) bool {
}
func ExportChain(blockchain *core.BlockChain, fn string) error {
- glog.Infoln("Exporting blockchain to", fn)
+ glog.Infoln("Exporting blockchain to ", fn)
fh, err := os.OpenFile(fn, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, os.ModePerm)
if err != nil {
return err
@@ -191,12 +191,12 @@ func ExportChain(blockchain *core.BlockChain, fn string) error {
if err := blockchain.Export(fh); err != nil {
return err
}
- glog.Infoln("Exported blockchain to", fn)
+ glog.Infoln("Exported blockchain to ", fn)
return nil
}
func ExportAppendChain(blockchain *core.BlockChain, fn string, first uint64, last uint64) error {
- glog.Infoln("Exporting blockchain to", fn)
+ glog.Infoln("Exporting blockchain to ", fn)
// TODO verify mode perms
fh, err := os.OpenFile(fn, os.O_CREATE|os.O_APPEND|os.O_WRONLY, os.ModePerm)
if err != nil {
@@ -206,6 +206,6 @@ func ExportAppendChain(blockchain *core.BlockChain, fn string, first uint64, las
if err := blockchain.ExportN(fh, first, last); err != nil {
return err
}
- glog.Infoln("Exported blockchain to", fn)
+ glog.Infoln("Exported blockchain to ", fn)
return nil
}
diff --git a/core/block_validator.go b/core/block_validator.go
index f777b9f23..c3f959324 100644
--- a/core/block_validator.go
+++ b/core/block_validator.go
@@ -64,7 +64,7 @@ func NewBlockValidator(config *ChainConfig, blockchain *BlockChain, pow pow.PoW)
//
// ValidateBlock also validates and makes sure that any previous state (or present)
// state that might or might not be present is checked to make sure that fast
-// sync has done it's job proper. This prevents the block validator form accepting
+// sync has done it's job proper. This prevents the block validator from accepting
// false positives where a header is present but the state is not.
func (v *BlockValidator) ValidateBlock(block *types.Block) error {
if v.bc.HasBlock(block.Hash()) {
@@ -139,7 +139,7 @@ func (v *BlockValidator) ValidateState(block, parent *types.Block, statedb *stat
// error if any of the included uncle headers were invalid. It returns an error
// if the validation failed.
func (v *BlockValidator) VerifyUncles(block, parent *types.Block) error {
- // validate that there at most 2 uncles included in this block
+ // validate that there are at most 2 uncles included in this block
if len(block.Uncles()) > 2 {
return ValidationError("Block can only contain maximum 2 uncles (contained %v)", len(block.Uncles()))
}
@@ -193,7 +193,7 @@ func (v *BlockValidator) ValidateHeader(header, parent *types.Header, checkPow b
if parent == nil {
return ParentError(header.ParentHash)
}
- // Short circuit if the header's already known or its parent missing
+ // Short circuit if the header's already known or its parent is missing
if v.bc.HasHeader(header.Hash()) {
return nil
}
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 70673799e..3e25e0c16 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -370,6 +370,27 @@ func (s *StateDB) IntermediateRoot() common.Hash {
return s.trie.Hash()
}
+// DeleteSuicides flags the suicided objects for deletion so that it
+// won't be referenced again when called / queried up on.
+//
+// DeleteSuicides should not be used for consensus related updates
+// under any circumstances.
+func (s *StateDB) DeleteSuicides() {
+ // Reset refund so that any used-gas calculations can use
+ // this method.
+ s.refund = new(big.Int)
+ for _, stateObject := range s.stateObjects {
+ if stateObject.dirty {
+ // If the object has been removed by a suicide
+ // flag the object as deleted.
+ if stateObject.remove {
+ stateObject.deleted = true
+ }
+ stateObject.dirty = false
+ }
+ }
+}
+
// Commit commits all state changes to the database.
func (s *StateDB) Commit() (root common.Hash, err error) {
root, batch := s.CommitBatch()
diff --git a/eth/api.go b/eth/api.go
index 3cb6c4d10..9f5f2e677 100644
--- a/eth/api.go
+++ b/eth/api.go
@@ -1876,6 +1876,7 @@ func (api *PrivateDebugAPI) TraceTransaction(txHash common.Hash, logger *vm.LogC
if err != nil {
return nil, fmt.Errorf("mutation failed: %v", err)
}
+ stateDb.DeleteSuicides()
continue
}
// Otherwise trace the transaction and return
diff --git a/rpc/doc.go b/rpc/doc.go
index 77202634f..14b3780ad 100644
--- a/rpc/doc.go
+++ b/rpc/doc.go
@@ -49,7 +49,7 @@ arguments. It will pass the mod argument as nil to the RPC method.
The server offers the ServeCodec method which accepts a ServerCodec instance. It will
read requests from the codec, process the request and sends the response back to the
client using the codec. The server can execute requests concurrently. Responses
-can be send back to the client out of order.
+can be sent back to the client out of order.
An example server which uses the JSON codec:
type CalculatorService struct {}
diff --git a/rpc/server.go b/rpc/server.go
index 69f3271e8..7b7d22063 100644
--- a/rpc/server.go
+++ b/rpc/server.go
@@ -82,7 +82,7 @@ func (s *RPCService) Modules() map[string]string {
return modules
}
-// RegisterName will create an service for the given rcvr type under the given name. When no methods on the given rcvr
+// RegisterName will create a service for the given rcvr type under the given name. When no methods on the given rcvr
// match the criteria to be either a RPC method or a subscription an error is returned. Otherwise a new service is
// created and added to the service collection this server instance serves.
func (s *Server) RegisterName(name string, rcvr interface{}) error {
@@ -236,7 +236,7 @@ func (s *Server) ServeSingleRequest(codec ServerCodec, options CodecOption) {
}
// Stop will stop reading new requests, wait for stopPendingRequestTimeout to allow pending requests to finish,
-// close all codecs which will cancels pending requests/subscriptions.
+// close all codecs which will cancel pending requests/subscriptions.
func (s *Server) Stop() {
if atomic.CompareAndSwapInt32(&s.run, 1, 0) {
glog.V(logger.Debug).Infoln("RPC Server shutdown initiatied")
@@ -294,7 +294,7 @@ func (s *Server) handle(ctx context.Context, codec ServerCodec, req *serverReque
return codec.CreateErrorResponse(&req.id, &callbackError{err.Error()}), nil
}
- // active the subscription after the sub id was successful sent to the client
+ // active the subscription after the sub id was successfully sent to the client
activateSub := func() {
notifier, _ := NotifierFromContext(ctx)
notifier.(*bufferedNotifier).activate(subid)