New gas prices model

This commit is contained in:
obscuren
2015-03-02 16:32:02 +01:00
parent 73c52d1677
commit b383ff0b96
5 changed files with 193 additions and 120 deletions

View File

@ -31,26 +31,48 @@ func NewVm(env Environment) VirtualMachine {
}
var (
GasStep = big.NewInt(1)
GasSha = big.NewInt(10)
GasSLoad = big.NewInt(20)
GasSStore = big.NewInt(100)
GasSStoreRefund = big.NewInt(100)
GasBalance = big.NewInt(20)
GasCreate = big.NewInt(100)
GasCall = big.NewInt(20)
GasCreateByte = big.NewInt(5)
GasSha3Byte = big.NewInt(10)
GasSha256Byte = big.NewInt(50)
GasRipemdByte = big.NewInt(50)
GasMemory = big.NewInt(1)
GasData = big.NewInt(5)
GasTx = big.NewInt(500)
GasLog = big.NewInt(32)
GasSha256 = big.NewInt(50)
GasRipemd = big.NewInt(50)
GasEcrecover = big.NewInt(500)
GasMemCpy = big.NewInt(1)
GasQuickStep = big.NewInt(2)
GasFastestStep = big.NewInt(3)
GasFastStep = big.NewInt(5)
GasMidStep = big.NewInt(8)
GasSlowStep = big.NewInt(10)
GasExtStep = big.NewInt(20)
GasStorageGet = big.NewInt(50)
GasStorageAdd = big.NewInt(20000)
GasStorageMod = big.NewInt(5000)
GasLogBase = big.NewInt(2000)
GasLogTopic = big.NewInt(2000)
GasLogData = big.NewInt(8)
GasCreate = big.NewInt(32000)
GasCreateByte = big.NewInt(300)
GasCall = big.NewInt(40)
GasCallValueTransfer = big.NewInt(6700)
GasCallNewAccount = big.NewInt(25000)
GasReturn = big.NewInt(0)
GasStop = big.NewInt(0)
GasJumpDest = big.NewInt(1)
RefundStorage = big.NewInt(15000)
RefundSuicide = big.NewInt(24000)
GasMemWord = big.NewInt(3)
GasQuadCoeffWord = big.NewInt(1)
GasContractByte = big.NewInt(200)
GasTransaction = big.NewInt(21000)
GasTxDataNonzeroByte = big.NewInt(37)
GasTxZeroByte = big.NewInt(2)
GasSha3Base = big.NewInt(30)
GasSha3Word = big.NewInt(6)
GasSha256Base = big.NewInt(60)
GasSha256Word = big.NewInt(12)
GasRipemdBase = big.NewInt(600)
GasRipemdWord = big.NewInt(12)
GasEcrecover = big.NewInt(3000)
GasIdentityBase = big.NewInt(15)
GasIdentityWord = big.NewInt(3)
GasCopyWord = big.NewInt(3)
Pow256 = ethutil.BigPow(2, 256)
@ -59,6 +81,8 @@ var (
U256 = ethutil.U256
S256 = ethutil.S256
Zero = ethutil.Big0
)
const MaxCallDepth = 1025