Browse Source

Merge branch 'develop' into js_abi

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
3df8ce248c
  1. 2
      libethcore/CommonEth.cpp
  2. 3
      libevm/FeeStructure.cpp
  3. 3
      libevm/FeeStructure.h
  4. 3
      libevm/VM.h
  5. 3
      libweb3jsonrpc/WebThreeStubServer.cpp
  6. 4
      libwhisper/Common.cpp
  7. 4
      libwhisper/Common.h
  8. 2
      libwhisper/Message.h

2
libethcore/CommonEth.cpp

@ -34,7 +34,7 @@ namespace dev
namespace eth
{
const unsigned c_protocolVersion = 40;
const unsigned c_protocolVersion = 41;
const unsigned c_databaseVersion = 4;
static const vector<pair<u256, string>> g_units =

3
libevm/FeeStructure.cpp

@ -37,3 +37,6 @@ u256 const dev::eth::c_callGas = 20;
u256 const dev::eth::c_memoryGas = 1;
u256 const dev::eth::c_txDataGas = 5;
u256 const dev::eth::c_txGas = 500;
u256 const dev::eth::c_logGas = 32;
u256 const dev::eth::c_logDataGas = 1;
u256 const dev::eth::c_logTopicGas = 32;

3
libevm/FeeStructure.h

@ -40,6 +40,9 @@ extern u256 const c_callGas; ///< Once per CALL operation & message call trans
extern u256 const c_memoryGas; ///< Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL.
extern u256 const c_txDataGas; ///< Per byte of data attached to a transaction. NOTE: Not payable on data of calls between transactions.
extern u256 const c_txGas; ///< Per transaction. NOTE: Not payable on data of calls between transactions.
extern u256 const c_logGas; ///< Per LOG* operation.
extern u256 const c_logDataGas; ///< Per byte in a LOG* operation's data.
extern u256 const c_logTopicGas; ///< Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas.
}
}

3
libevm/VM.h

@ -206,7 +206,8 @@ template <class Ext> dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con
{
unsigned n = (unsigned)inst - (unsigned)Instruction::LOG0;
require(n + 2);
newTempSize = memNeed(m_stack[m_stack.size() - 1 ], m_stack[m_stack.size() - 2]);
runGas = c_logGas + c_logTopicGas * n + c_logDataGas * m_stack[m_stack.size() - 2];
newTempSize = memNeed(m_stack[m_stack.size() - 1], m_stack[m_stack.size() - 2]);
break;
}

3
libweb3jsonrpc/WebThreeStubServer.cpp

@ -273,14 +273,13 @@ static Json::Value toJson(h256 const& _h, shh::Envelope const& _e, shh::Message
res["ttl"] = (int)_e.ttl();
res["workProved"] = (int)_e.workProved();
for (auto const& t: _e.topics())
res["topics"].append(toJS((u256)t));
res["topics"].append(toJS(t));
res["payload"] = toJS(_m.payload());
res["from"] = toJS(_m.from());
res["to"] = toJS(_m.to());
return res;
}
WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, WebThreeDirect& _web3, std::vector<dev::KeyPair> const& _accounts):
AbstractWebThreeStubServer(_conn),
m_web3(_web3)

4
libwhisper/Common.cpp

@ -33,7 +33,7 @@ Topic BuildTopic::toTopic() const
Topic ret;
ret.reserve(m_parts.size());
for (auto const& h: m_parts)
ret.push_back((TopicPart)u256(h));
ret.push_back(TopicPart(h));
return ret;
}
@ -69,7 +69,7 @@ TopicMask BuildTopicMask::toTopicMask() const
TopicMask ret;
ret.reserve(m_parts.size());
for (auto const& h: m_parts)
ret.push_back(make_pair((TopicPart)u256(h), h ? ~(uint32_t)0 : 0));
ret.push_back(make_pair(TopicPart(h), h ? ~TopicPart() : TopicPart()));
return ret;
}

4
libwhisper/Common.h

@ -59,7 +59,7 @@ enum WhisperPacket
PacketCount
};
using TopicPart = uint32_t;
using TopicPart = FixedHash<4>;
using Topic = std::vector<TopicPart>;
@ -92,7 +92,7 @@ public:
TopicFilter() {}
TopicFilter(TopicMask const& _m): m_topicMasks(1, _m) {}
TopicFilter(TopicMasks const& _m): m_topicMasks(_m) {}
TopicFilter(RLP const& _r): m_topicMasks(_r.toVector<std::vector<std::pair<uint32_t, uint32_t>>>()) {}
TopicFilter(RLP const& _r): m_topicMasks(_r.toVector<std::vector<std::pair<FixedHash<4>, FixedHash<4>>>>()) {}
void streamRLP(RLPStream& _s) const { _s << m_topicMasks; }
h256 sha3() const;

2
libwhisper/Message.h

@ -55,7 +55,7 @@ public:
{
m_expiry = _m[0].toInt<unsigned>();
m_ttl = _m[1].toInt<unsigned>();
m_topic = _m[2].toVector<uint32_t>();
m_topic = _m[2].toVector<FixedHash<4>>();
m_data = _m[3].toBytes();
m_nonce = _m[4].toInt<u256>();
}

Loading…
Cancel
Save