diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index fe56122064..24c15c4f83 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -41,7 +41,10 @@ var ( ByzantiumBlockReward *big.Int = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium maxUncles = 2 // Maximum number of uncles allowed in a single block allowedFutureBlockTime = 15 * time.Second // Max time from current time allowed for blocks, before they're considered future blocks - //@note: @shyft + //@note: @shyft This is the Shyft block reward numbers + // ShyftNetworkBlockReward = Block reward for the shyft conduit contract. + // ShyftMinerBlockReward = Block reward for the miner. + // ShyftNetworkConduitAddress = Shyft conduit contract ShyftNetworkBlockReward *big.Int = big.NewInt(2.5e+18) // Block reward in wei for successfully mining a block, for the Shyft Network ShyftMinerBlockReward *big.Int = big.NewInt(2.5e+18) // Block reward in wei for successfully mining a block, for the Shyft Network ShyftNetworkConduitAddress = common.HexToAddress("9db76b4bbaea76dfda4552b7b9d4e9d43abc55fd") diff --git a/core/chain_makers.go b/core/chain_makers.go index bd6ba265ba..f831a0518a 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -267,7 +267,7 @@ func newCanonical(engine consensus.Engine, n int, full bool) (ethdb.Database, *B headers := makeHeaderChain(genesis.Header(), n, engine, db, canonicalSeed) foo, err := blockchain.InsertHeaderChain(headers, 1) // foo is so the compiler doesn't complain - // @shyft remove this + // @NOTE:SHYFT @TODO: remove this. fmt.Println(foo) return db, blockchain, err } diff --git a/eth/backend.go b/eth/backend.go index b5c99965c7..37b4549868 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -103,7 +103,6 @@ func (s *Ethereum) AddLesServer(ls LesServer) { // New creates a new Ethereum object (including the // initialisation of the common Ethereum object) func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { - // @NOTE:shyft Where we instantiate BlockExplorerDB if config.SyncMode == downloader.LightSync { return nil, errors.New("can't run eth.Ethereum in light sync mode, use les.LightEthereum") } @@ -115,7 +114,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { return nil, err } - // @NOTE:shyft instantiate BlockExplorerDB here? + // @NOTE:shyft instantiate BlockExplorerDB here + // @TODO: Create Genesis Block blockExplorerDb, err := leveldb.OpenFile("./shyftData/geth/blockExplorerDb/", nil) if err != nil { return nil, err diff --git a/shyftdb/shyft_database_util.go b/shyftdb/shyft_database_util.go index 660f3bb8df..4ed1b89a23 100644 --- a/shyftdb/shyft_database_util.go +++ b/shyftdb/shyft_database_util.go @@ -49,14 +49,12 @@ type ShyftAccountEntry struct { } func WriteBlock(db *leveldb.DB, block *types.Block) error { + fmt.Println("+++++++++++++++++++++++++++ BLOCK NUMBER", block.Number()) + fmt.Println("+++++++++++++++++++++++++++ # of TX", len(block.Transactions())) leng := block.Transactions().Len() var tx_strs = make([]string, leng) - //var tx_bytes = make([]byte, leng) hash := block.Header().Hash().Bytes() - fmt.Println("The tx_strs is") - fmt.Println(tx_strs) - //strs := []string{"foo", "bar"} buf := &bytes.Buffer{} gob.NewEncoder(buf).Encode(tx_strs) bs := buf.Bytes() @@ -71,7 +69,6 @@ func WriteBlock(db *leveldb.DB, block *types.Block) error { if block.Transactions().Len() > 0 { for i, tx := range block.Transactions() { tx_strs[i] = WriteTransactions(db, tx, block.Header().Hash()) - //tx_bytes[i] = tx.Hash().Bytes() } } return nil @@ -167,7 +164,7 @@ func WriteToBalance(db *leveldb.DB, tx *types.Transaction) { // @NOTE: This function is extremely complex and requires heavy testing and knowdlege of edge cases: // uncle blocks, account balance updates based on reorgs, diverges that get dropped. // Reason for this is because the accounts are not deterministic like the block and tx hashes. -// @TODO: Calculate reward from uncles +// @TODO: Calculate reward if there are uncles // @TODO: Calculate mining reward (most likely retrieve higher up in the operations) // @TODO: Calculate reorg func WriteMinerReward(db *leveldb.DB, block *types.Block) { @@ -333,4 +330,4 @@ func GetTransaction (db *leveldb.DB, tx *types.Transaction) ShyftTxEntryPretty { //fmt.Println("Data: ", txData.Data) } return prettyFormat -} \ No newline at end of file +}