Set Rewards in POA and set params compatibles with ETC/ETH

This commit is contained in:
Yohan Graterol 2017-12-26 14:45:45 -05:00
parent ef128e9b0e
commit 118dacddaf
7 changed files with 13 additions and 10 deletions

View file

@ -40,6 +40,7 @@ import (
"github.com/EthereumCommonwealth/go-callisto/rlp" "github.com/EthereumCommonwealth/go-callisto/rlp"
"github.com/EthereumCommonwealth/go-callisto/rpc" "github.com/EthereumCommonwealth/go-callisto/rpc"
lru "github.com/hashicorp/golang-lru" lru "github.com/hashicorp/golang-lru"
"github.com/EthereumCommonwealth/go-callisto/consensus/ethash"
) )
const ( const (
@ -574,6 +575,7 @@ func (c *Clique) Prepare(chain consensus.ChainReader, header *types.Header) erro
// rewards given, and returns the final block. // rewards given, and returns the final block.
func (c *Clique) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) { func (c *Clique) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (*types.Block, error) {
// No block rewards in PoA, so the state remains as is and uncles are dropped // No block rewards in PoA, so the state remains as is and uncles are dropped
ethash.AccumulateRewards(chain.Config(), state, header, uncles)
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number)) header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
header.UncleHash = types.CalcUncleHash(nil) header.UncleHash = types.CalcUncleHash(nil)

View file

@ -325,7 +325,7 @@ func DefaultCallistoMainnetGenesisBlock() *Genesis {
return &Genesis{ return &Genesis{
Config: params.CallistoMainnetChainConfig, Config: params.CallistoMainnetChainConfig,
ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000"), ExtraData: hexutil.MustDecode("0x0000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 470000000, GasLimit: 4700000,
Difficulty: big.NewInt(4000000), Difficulty: big.NewInt(4000000),
Alloc: decodePrealloc(callistoMainnetAllocData), Alloc: decodePrealloc(callistoMainnetAllocData),
} }
@ -348,7 +348,7 @@ func DefaultCallistoTestnetGenesisBlock() *Genesis {
return &Genesis{ return &Genesis{
Config: params.CallistoTestnetChainConfig, Config: params.CallistoTestnetChainConfig,
ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000004fd2dead40490e7efb256899289896c844280e3dceb6e1affb81eae90695efd61e9d2c214f72b8cf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"), ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000004fd2dead40490e7efb256899289896c844280e3dceb6e1affb81eae90695efd61e9d2c214f72b8cf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 470000000, GasLimit: 5200000,
Difficulty: big.NewInt(1), Difficulty: big.NewInt(1),
Alloc: decodePrealloc(callistoTestnetAllocData), Alloc: decodePrealloc(callistoTestnetAllocData),
} }

File diff suppressed because one or more lines are too long

View file

@ -45,7 +45,7 @@ var DefaultConfig = Config{
NetworkId: 1, NetworkId: 1,
LightPeers: 20, LightPeers: 20,
DatabaseCache: 128, DatabaseCache: 128,
GasPrice: big.NewInt(18 * params.Shannon), GasPrice: big.NewInt(1800 * params.Shannon),
TxPool: core.DefaultTxPoolConfig, TxPool: core.DefaultTxPoolConfig,
GPO: gasprice.Config{ GPO: gasprice.Config{

View file

@ -28,7 +28,7 @@ import (
"github.com/EthereumCommonwealth/go-callisto/rpc" "github.com/EthereumCommonwealth/go-callisto/rpc"
) )
var maxPrice = big.NewInt(500 * params.Shannon) var maxPrice = big.NewInt(1800 * params.Shannon)
type Config struct { type Config struct {
Blocks int Blocks int

View file

@ -86,9 +86,10 @@ var (
EIP158Block: big.NewInt(0), EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(4), ByzantiumBlock: big.NewInt(4),
CallistoBlock: big.NewInt(1), CallistoBlock: big.NewInt(1),
CallistoTreasuryAddress: common.HexToAddress("0x74682Fc32007aF0b6118F259cBe7bCCC21641600"),
Clique: &CliqueConfig{ Clique: &CliqueConfig{
Period: 15, Period: 10,
Epoch: 30000, Epoch: 30000,
}, },
} }
@ -239,11 +240,11 @@ func (c *ChainConfig) IsCallisto(num *big.Int) bool {
// Callisto has a 10x more cost in gas // Callisto has a 10x more cost in gas
func (c *ChainConfig) GasTable(num *big.Int) GasTable { func (c *ChainConfig) GasTable(num *big.Int) GasTable {
if num == nil { if num == nil {
return GasTableCallisto return GasTableEIP158
} }
switch { switch {
case c.IsCallisto(num): case c.IsCallisto(num):
return GasTableCallisto return GasTableEIP158
case c.IsEIP158(num): case c.IsEIP158(num):
return GasTableEIP158 return GasTableEIP158
case c.IsEIP150(num): case c.IsEIP150(num):

View file

@ -24,8 +24,8 @@ const (
SloadGas uint64 = 50 // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added. SloadGas uint64 = 50 // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added.
CallValueTransferGas uint64 = 9000 // Paid for CALL when the value transfer is non-zero. CallValueTransferGas uint64 = 9000 // Paid for CALL when the value transfer is non-zero.
CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior. CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior.
TxGas uint64 = 2100000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. TxGas uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions.
TxGasContractCreation uint64 = 5300000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions. TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation. QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation.
SstoreSetGas uint64 = 20000 // Once per SLOAD operation. SstoreSetGas uint64 = 20000 // Once per SLOAD operation.