rust-ethereum / ethereum Goto Github PK
View Code? Open in Web Editor NEWCommon Ethereum structs for Rust.
Home Page: https://source.that.world/source/ethereum-rs/
License: Apache License 2.0
Common Ethereum structs for Rust.
Home Page: https://source.that.world/source/ethereum-rs/
License: Apache License 2.0
It'd be nice if you can release 0.12.0, so we can update primitive-types
and ethereum
in Sputnik: rust-ethereum/evm#101
As currently implemented, the Receipts message test case in EIP-2481 cannot be deserialized. This is because the definition of Receipt uses type H256 (which has a fixed-sized, 32 byte serialization) instead of U256, which has a variable length serialization.
pub struct Receipt {
pub state_root: H256, // Should to be U256
pub used_gas: U256,
pub logs_bloom: Bloom,
pub logs: Vec<Log>,
}
To verify the issue, you can use an RLP debugger to deserialize the test case and check that the entry corresponding to state_root is encoded as a number, not a vector.
You can also reproduce the issue by pulling akula-bft/akula#19 locally, patching your ethereum
crate on disk, and then verifying that the unit test decode_receipts
passes.
pub struct Account { pub nonce: U256, ... }
But in go ethereum, it is
type Account struct { Nonce uint64 ... }
looks like 24 bytes are wasted, is this intended? why?
There is no need to implement rlp::Encodable
and rlp::Decodable
on the enveloped TransactionV1
and TransactionV2
types.
According to EIP-2718, the leading byte of an enveloped transaction determines the format of the remaining bytes, but the envelope itself is not rlp-encoded.
In other words, the format for enveloped transactions is TransactionType || TransactionPayload
, so in the case of EIP1559 transactions for example, the envelope should be 0x02 || rlp(EIP1559Transaction)
. However using this library, you effectively end up with rlp(0x02 || rlp(EIP1559Transaction))
, which is incorrect.
This means, for example, I would have expected to be able to decode a raw ethereum tx like so: TransactionV2::decode(&raw_bytes)
, however for non-legacy transactions this fails with RlpExpectedToBeList
.
It might make sense to remove/deprecate the implementations of rlp::Encodable
and rlp::Decodable
for the TransactionV1
and TransactionV2
enums since there should never be a reason to rlp-encode the envelope in the first place.
type: {
path: [
ethereum
transaction
AccessListItem
]
params: []
def: {
Composite: {
fields: [
{
name: address
type: 37
typeName: Address
docs: []
}
{
name: slots
type: 170
typeName: Vec<H256>
docs: []
}
]
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.