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

Frontier/513 #616

Merged
merged 2 commits into from
Apr 1, 2015
Merged

Frontier/513 #616

merged 2 commits into from
Apr 1, 2015

Conversation

bas-vk
Copy link
Member

@bas-vk bas-vk commented Apr 1, 2015

A pointer to the default gas value is assigned to a member field of a message which is passed to the evm for execution. In the evm the used gas is subtracted which causes the default gas value to decrease on each call when no gas value is supplied. After enough calls the user runs "out of gas".

@@ -128,8 +128,8 @@ func cTopics(t [][]string) [][]common.Hash {
return topics
}

func (self *XEth) DefaultGas() *big.Int { return defaultGas }
func (self *XEth) DefaultGasPrice() *big.Int { return defaultGasPrice }
func (self *XEth) DefaultGas() *big.Int { return big.NewInt(defaultGas.Int64()) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to

return new(big.Int).Set(defaultGas)
  1. Potential risk for overflow once we've added price discovery
  2. Big => int => big will do the following
b = COMP_TO_BYTES(big)
i = BIN_TO_INT(b)
b = INT_TO_BIN(i)
big = BYTES_TO_COMP(b)

where as Set will do a copy

obscuren added a commit that referenced this pull request Apr 1, 2015
@obscuren obscuren merged commit 936ddf2 into ethereum:develop Apr 1, 2015
@obscuren obscuren removed the fixed label Apr 1, 2015
@obscuren obscuren added this to the Frontier milestone Apr 1, 2015
tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this pull request Jan 20, 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.

2 participants