Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth: add GasPriceOracle #990

Merged
merged 9 commits into from
Jun 15, 2015
Merged

eth: add GasPriceOracle #990

merged 9 commits into from
Jun 15, 2015

Conversation

zsfelfoldi
Copy link
Contributor

No description provided.

@@ -419,7 +422,25 @@ func (self *ChainManager) GetBlock(hash common.Hash) *types.Block {
glog.V(logger.Error).Infof("invalid block RLP for hash %x: %v", hash, err)
return nil
}
return (*types.Block)(&block)

blk := (*types.Block)(&block)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be moved to its own separate function. We want to limit the amount of database gets and RLP decoding required to get a block. Most cases when GetBlock is called you don't require the receipts.

Move this to an additional method like

func (cm *ChainManager) GetReceipts(block *types.Block) types.Receipts {
    // your code
}

@tgerring
Copy link
Contributor

@zsfelfoldi If it's not too much effort, can you add a method to XEth to access the receipts? This would be to support #1042

@obscuren
Copy link
Contributor

@zsfelfoldi @tgerring as per my question on gitter. Separate the transaction receipt storing in a new PR

@zsfelfoldi
Copy link
Contributor Author

@tgerring Ok, I'll do that later today or tomorrow morning.

@zsfelfoldi
Copy link
Contributor Author

#1049

@fjl fjl changed the title GasPriceOracle eth: add GasPriceOracle May 25, 2015
@zsfelfoldi zsfelfoldi force-pushed the gasprice branch 2 times, most recently from 69323ea to 9182cf7 Compare May 27, 2015 10:45
@obscuren obscuren added this to the 0.9.30 milestone Jun 10, 2015
@zsfelfoldi zsfelfoldi self-assigned this Jun 10, 2015
@obscuren
Copy link
Contributor

Mining just empty blocks:

11062348998802'
> I0611 00:23:29.796654   84753 chain_manager.go:686] imported 4 block(s) (0 queued 0 ignored) in 8.59473ms. #80 [a6a89a15 / cafa7387]
I0611 00:23:29.797283   84753 worker.go:413] commit new work on block 81 with 0 txs & 1 uncles
> eth.gasPrice
'10957699177273'
> I0611 00:23:30.982363   84753 chain_manager.go:686] imported 1 block(s) (0 queued 0 ignored) in 10.982954ms. #81 [eaf58cd0 / eaf58cd0]
I0611 00:23:30.982507   84753 worker.go:256] 🔨  Mined block (#81 / eaf58cd0). Wait 5 blocks for confirmation
I0611 00:23:30.983298   84753 worker.go:413] commit new work on block 82 with 0 txs & 2 uncles
I0611 00:23:32.064667   84753 chain_manager.go:686] imported 1 block(s) (0 queued 0 ignored) in 14.537861ms. #82 [510b1350 / 510b1350]
I0611 00:23:32.065081   84753 worker.go:256] 🔨  Mined block (#82 / 510b1350). Wait 5 blocks for confirmation
I0611 00:23:32.065972   84753 worker.go:413] commit new work on block 83 with 0 txs & 0 uncles
> eth.gasPriceI0611 00:23:32.350849   84753 chain_manager.go:686] imported 1 block(s) (0 queued 0 ignored) in 5.931852ms. #83 [62056c3b / 62056c3b]
I0611 00:23:32.351061   84753 worker.go:256] 🔨  Mined block (#83 / 62056c3b). Wait 5 blocks for confirmation
I0611 00:23:32.351897   84753 worker.go:413] commit new work on block 84 with 0 txs & 0 uncles

'11845227651911'
> I0611 00:23:33.381041   84753 chain_manager.go:686] imported 1 block(s) (0 queued 0 ignored) in 5.865722ms. #84 [c78e753f / c78e753f]
I0611 00:23:33.381149   84753 worker.go:256] 🔨  Mined block (#84 / c78e753f). Wait 5 blocks for confirmation
I0611 00:23:33.382113   84753 worker.go:413] commit new work on block 85 with 0 txs & 0 uncles
> eth.gasPrice
'11734000964259'

Shouldn't it dip below 1000...00 ?

@zsfelfoldi
Copy link
Contributor Author

I think it shouldn't (that's the absolute minimum value), see gitter private channel.

obscuren added a commit that referenced this pull request Jun 15, 2015
@obscuren obscuren merged commit f2a2164 into ethereum:develop Jun 15, 2015
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this pull request Jan 20, 2022
Description
Documentations fixes

Related issues
Fixes ethereum#896
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants