mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
libevmadm: EIP150.a changes on EXTCODE, EXTCODESIZE and BALANCE
This commit is contained in:
parent
7da9ba68e9
commit
f2775f82d0
@ -232,6 +232,8 @@ unsigned GasMeter::runGas(Instruction _instruction)
|
|||||||
case Tier::High: return GasCosts::tier5Gas;
|
case Tier::High: return GasCosts::tier5Gas;
|
||||||
case Tier::Ext: return GasCosts::tier6Gas;
|
case Tier::Ext: return GasCosts::tier6Gas;
|
||||||
case Tier::Special: return GasCosts::tier7Gas;
|
case Tier::Special: return GasCosts::tier7Gas;
|
||||||
|
case Tier::ExtCode: return GasCosts::extCodeGas;
|
||||||
|
case Tier::Balance: return GasCosts::balanceGas;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
assertThrow(false, OptimizerException, "Invalid gas tier.");
|
assertThrow(false, OptimizerException, "Invalid gas tier.");
|
||||||
|
@ -44,6 +44,8 @@ namespace GasCosts
|
|||||||
static unsigned const tier5Gas = 10;
|
static unsigned const tier5Gas = 10;
|
||||||
static unsigned const tier6Gas = 20;
|
static unsigned const tier6Gas = 20;
|
||||||
static unsigned const tier7Gas = 0;
|
static unsigned const tier7Gas = 0;
|
||||||
|
static unsigned const extCodeGas = 700;
|
||||||
|
static unsigned const balanceGas = 400;
|
||||||
static unsigned const expGas = 10;
|
static unsigned const expGas = 10;
|
||||||
static unsigned const expByteGas = 10;
|
static unsigned const expByteGas = 10;
|
||||||
static unsigned const sha3Gas = 30;
|
static unsigned const sha3Gas = 30;
|
||||||
|
@ -191,7 +191,7 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
|
|||||||
{ Instruction::SIGNEXTEND, { "SIGNEXTEND", 0, 2, 1, false, Tier::Low } },
|
{ Instruction::SIGNEXTEND, { "SIGNEXTEND", 0, 2, 1, false, Tier::Low } },
|
||||||
{ Instruction::SHA3, { "SHA3", 0, 2, 1, false, Tier::Special } },
|
{ Instruction::SHA3, { "SHA3", 0, 2, 1, false, Tier::Special } },
|
||||||
{ Instruction::ADDRESS, { "ADDRESS", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::ADDRESS, { "ADDRESS", 0, 0, 1, false, Tier::Base } },
|
||||||
{ Instruction::BALANCE, { "BALANCE", 0, 1, 1, false, Tier::Ext } },
|
{ Instruction::BALANCE, { "BALANCE", 0, 1, 1, false, Tier::Balance } },
|
||||||
{ Instruction::ORIGIN, { "ORIGIN", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::ORIGIN, { "ORIGIN", 0, 0, 1, false, Tier::Base } },
|
||||||
{ Instruction::CALLER, { "CALLER", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::CALLER, { "CALLER", 0, 0, 1, false, Tier::Base } },
|
||||||
{ Instruction::CALLVALUE, { "CALLVALUE", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::CALLVALUE, { "CALLVALUE", 0, 0, 1, false, Tier::Base } },
|
||||||
@ -201,8 +201,8 @@ static const std::map<Instruction, InstructionInfo> c_instructionInfo =
|
|||||||
{ Instruction::CODESIZE, { "CODESIZE", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::CODESIZE, { "CODESIZE", 0, 0, 1, false, Tier::Base } },
|
||||||
{ Instruction::CODECOPY, { "CODECOPY", 0, 3, 0, true, Tier::VeryLow } },
|
{ Instruction::CODECOPY, { "CODECOPY", 0, 3, 0, true, Tier::VeryLow } },
|
||||||
{ Instruction::GASPRICE, { "GASPRICE", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::GASPRICE, { "GASPRICE", 0, 0, 1, false, Tier::Base } },
|
||||||
{ Instruction::EXTCODESIZE, { "EXTCODESIZE", 0, 1, 1, false, Tier::Ext } },
|
{ Instruction::EXTCODESIZE, { "EXTCODESIZE", 0, 1, 1, false, Tier::ExtCode } },
|
||||||
{ Instruction::EXTCODECOPY, { "EXTCODECOPY", 0, 4, 0, true, Tier::Ext } },
|
{ Instruction::EXTCODECOPY, { "EXTCODECOPY", 0, 4, 0, true, Tier::ExtCode } },
|
||||||
{ Instruction::BLOCKHASH, { "BLOCKHASH", 0, 1, 1, false, Tier::Ext } },
|
{ Instruction::BLOCKHASH, { "BLOCKHASH", 0, 1, 1, false, Tier::Ext } },
|
||||||
{ Instruction::COINBASE, { "COINBASE", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::COINBASE, { "COINBASE", 0, 0, 1, false, Tier::Base } },
|
||||||
{ Instruction::TIMESTAMP, { "TIMESTAMP", 0, 0, 1, false, Tier::Base } },
|
{ Instruction::TIMESTAMP, { "TIMESTAMP", 0, 0, 1, false, Tier::Base } },
|
||||||
|
@ -237,6 +237,8 @@ enum class Tier : unsigned
|
|||||||
Mid, // 8, Mid
|
Mid, // 8, Mid
|
||||||
High, // 10, Slow
|
High, // 10, Slow
|
||||||
Ext, // 20, Ext
|
Ext, // 20, Ext
|
||||||
|
ExtCode, // 700, Extcode
|
||||||
|
Balance, // 400, Balance
|
||||||
Special, // multiparam or otherwise special
|
Special, // multiparam or otherwise special
|
||||||
Invalid // Invalid.
|
Invalid // Invalid.
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user