mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
Merge branch 'ethereum:master' into master
This commit is contained in:
commit
46cfd1326b
19 changed files with 1248 additions and 48 deletions
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
|
@ -29,5 +29,5 @@ miner/ @MariusVanDerWijden @fjl @rjl493456442
|
||||||
node/ @fjl
|
node/ @fjl
|
||||||
p2p/ @fjl @zsfelfoldi
|
p2p/ @fjl @zsfelfoldi
|
||||||
rlp/ @fjl
|
rlp/ @fjl
|
||||||
params/ @fjl @karalabe @gballet @rjl493456442 @zsfelfoldi
|
params/ @fjl @gballet @rjl493456442 @zsfelfoldi
|
||||||
rpc/ @fjl
|
rpc/ @fjl
|
||||||
|
|
|
||||||
161
cmd/geth/testdata/vcheck/data.json
vendored
161
cmd/geth/testdata/vcheck/data.json
vendored
|
|
@ -6,28 +6,33 @@
|
||||||
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://github.com/ethereum/go-ethereum/pull/21793",
|
"https://github.com/ethereum/go-ethereum/pull/21793",
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49"
|
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-v592-xf75-856p"
|
||||||
],
|
],
|
||||||
"introduced": "v1.6.0",
|
"introduced": "v1.6.0",
|
||||||
"fixed": "v1.9.24",
|
"fixed": "v1.9.24",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Medium",
|
"severity": "Medium",
|
||||||
"check": "Geth\\/v1\\.(6|7|8)\\..*|Geth\\/v1\\.9\\.2(1|2|3)-.*"
|
"CVE": "CVE-2020-26240",
|
||||||
|
"check": "Geth\\/v1\\.(6|7|8)\\..*|Geth\\/v1\\.9\\.\\d-.*|Geth\\/v1\\.9\\.1.*|Geth\\/v1\\.9\\.2(0|1|2|3)-.*"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "GoCrash",
|
"name": "Denial of service due to Go CVE-2020-28362",
|
||||||
"uid": "GETH-2020-02",
|
"uid": "GETH-2020-02",
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
||||||
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
||||||
"https://github.com/golang/go/issues/42552"
|
"https://github.com/golang/go/issues/42552",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-m6gx-rhvj-fh52"
|
||||||
],
|
],
|
||||||
|
"introduced": "v0.0.0",
|
||||||
"fixed": "v1.9.24",
|
"fixed": "v1.9.24",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Critical",
|
"severity": "Critical",
|
||||||
|
"CVE": "CVE-2020-28362",
|
||||||
"check": "Geth.*\\/go1\\.(11(.*)|12(.*)|13(.*)|14|14\\.(\\d|10|11|)|15|15\\.[0-4])$"
|
"check": "Geth.*\\/go1\\.(11(.*)|12(.*)|13(.*)|14|14\\.(\\d|10|11|)|15|15\\.[0-4])$"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -36,26 +41,162 @@
|
||||||
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
||||||
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/"
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-69v6-xc2j-r2jf"
|
||||||
],
|
],
|
||||||
"introduced": "v1.9.7",
|
"introduced": "v1.9.7",
|
||||||
"fixed": "v1.9.17",
|
"fixed": "v1.9.17",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Critical",
|
"severity": "Critical",
|
||||||
|
"CVE": "CVE-2020-26241",
|
||||||
"check": "Geth\\/v1\\.9\\.(7|8|9|10|11|12|13|14|15|16).*$"
|
"check": "Geth\\/v1\\.9\\.(7|8|9|10|11|12|13|14|15|16).*$"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "GethCrash",
|
"name": "Geth DoS via MULMOD",
|
||||||
"uid": "GETH-2020-04",
|
"uid": "GETH-2020-04",
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
||||||
"description": "Full details to be disclosed at a later date",
|
"description": "Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/"
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m",
|
||||||
|
"https://github.com/holiman/uint256/releases/tag/v1.1.1",
|
||||||
|
"https://github.com/holiman/uint256/pull/80",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/21368"
|
||||||
],
|
],
|
||||||
"introduced": "v1.9.16",
|
"introduced": "v1.9.16",
|
||||||
"fixed": "v1.9.18",
|
"fixed": "v1.9.18",
|
||||||
"published": "2020-11-12",
|
"published": "2020-11-12",
|
||||||
"severity": "Critical",
|
"severity": "Critical",
|
||||||
|
"CVE": "CVE-2020-26242",
|
||||||
"check": "Geth\\/v1\\.9.(16|17).*$"
|
"check": "Geth\\/v1\\.9.(16|17).*$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "LES Server DoS via GetProofsV2",
|
||||||
|
"uid": "GETH-2020-05",
|
||||||
|
"summary": "A DoS vulnerability can make a LES server crash.",
|
||||||
|
"description": "A DoS vulnerability can make a LES server crash via malicious GetProofsV2 request from a connected LES client.\n\nThe vulnerability was patched in #21896.\n\nThis vulnerability only concern users explicitly running geth as a light server",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-r33q-22hv-j29q",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/21896"
|
||||||
|
],
|
||||||
|
"introduced": "v1.8.0",
|
||||||
|
"fixed": "v1.9.25",
|
||||||
|
"published": "2020-12-10",
|
||||||
|
"severity": "Medium",
|
||||||
|
"CVE": "CVE-2020-26264",
|
||||||
|
"check": "(Geth\\/v1\\.8\\.*)|(Geth\\/v1\\.9\\.\\d-.*)|(Geth\\/v1\\.9\\.1\\d-.*)|(Geth\\/v1\\.9\\.(20|21|22|23|24)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "SELFDESTRUCT-recreate consensus flaw",
|
||||||
|
"uid": "GETH-2020-06",
|
||||||
|
"introduced": "v1.9.4",
|
||||||
|
"fixed": "v1.9.20",
|
||||||
|
"summary": "A consensus-vulnerability in Geth could cause a chain split, where vulnerable versions refuse to accept the canonical chain.",
|
||||||
|
"description": "A flaw was repoted at 2020-08-11 by John Youngseok Yang (Software Platform Lab), where a particular sequence of transactions could cause a consensus failure.\n\n- Tx 1:\n - `sender` invokes `caller`.\n - `caller` invokes `0xaa`. `0xaa` has 3 wei, does a self-destruct-to-self\n - `caller` does a `1 wei` -call to `0xaa`, who thereby has 1 wei (the code in `0xaa` still executed, since the tx is still ongoing, but doesn't redo the selfdestruct, it takes a different path if callvalue is non-zero)\n\n-Tx 2:\n - `sender` does a 5-wei call to 0xaa. No exec (since no code). \n\nIn geth, the result would be that `0xaa` had `6 wei`, whereas OE reported (correctly) `5` wei. Furthermore, in geth, if the second tx was not executed, the `0xaa` would be destructed, resulting in `0 wei`. Thus obviously wrong. \n\nIt was determined that the root cause was this [commit](https://github.com/ethereum/go-ethereum/commit/223b950944f494a5b4e0957fd9f92c48b09037ad) from [this PR](https://github.com/ethereum/go-ethereum/pull/19953). The semantics of `createObject` was subtly changd, into returning a non-nil object (with `deleted=true`) where it previously did not if the account had been destructed. This return value caused the new object to inherit the old `balance`.\n",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-xw37-57qp-9mm4"
|
||||||
|
],
|
||||||
|
"published": "2020-12-10",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2020-26265",
|
||||||
|
"check": "(Geth\\/v1\\.9\\.(4|5|6|7|8|9)-.*)|(Geth\\/v1\\.9\\.1\\d-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Not ready for London upgrade",
|
||||||
|
"uid": "GETH-2021-01",
|
||||||
|
"summary": "The client is not ready for the 'London' technical upgrade, and will deviate from the canonical chain when the London upgrade occurs (at block '12965000' around August 4, 2021.",
|
||||||
|
"description": "At (or around) August 4, Ethereum will undergo a technical upgrade called 'London'. Clients not upgraded will fail to progress on the canonical chain.",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md",
|
||||||
|
"https://notes.ethereum.org/@timbeiko/ropsten-postmortem"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.1",
|
||||||
|
"fixed": "v1.10.6",
|
||||||
|
"published": "2021-07-22",
|
||||||
|
"severity": "High",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(1|2|3|4|5)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RETURNDATA corruption via datacopy",
|
||||||
|
"uid": "GETH-2021-02",
|
||||||
|
"summary": "A consensus-flaw in the Geth EVM could cause a node to deviate from the canonical chain.",
|
||||||
|
"description": "A memory-corruption bug within the EVM can cause a consensus error, where vulnerable nodes obtain a different `stateRoot` when processing a maliciously crafted transaction. This, in turn, would lead to the chain being split: mainnet splitting in two forks.\n\nAll Geth versions supporting the London hard fork are vulnerable (the bug is older than London), so all users should update.\n\nThis bug was exploited on Mainnet at block 13107518.\n\nCredits for the discovery go to @guidovranken (working for Sentnl during an audit of the Telos EVM) and reported via bounty@ethereum.org.",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/blob/master/docs/postmortems/2021-08-22-split-postmortem.md",
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-9856-9gg9-qcmq",
|
||||||
|
"https://github.com/ethereum/go-ethereum/releases/tag/v1.10.8"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.10.8",
|
||||||
|
"published": "2021-08-24",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2021-39137",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(0|1|2|3|4|5|6|7)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious `snap/1` request",
|
||||||
|
"uid": "GETH-2021-03",
|
||||||
|
"summary": "A vulnerable node is susceptible to crash when processing a maliciously crafted message from a peer, via the snap/1 protocol. The crash can be triggered by sending a malicious snap/1 GetTrieNodes package.",
|
||||||
|
"description": "The `snap/1` protocol handler contains two vulnerabilities related to the `GetTrieNodes` packet, which can be exploited to crash the node. Full details are available at the Github security [advisory](https://github.com/ethereum/go-ethereum/security/advisories/GHSA-59hh-656j-3p7v)",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-59hh-656j-3p7v",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/23657"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.10.9",
|
||||||
|
"published": "2021-10-24",
|
||||||
|
"severity": "Medium",
|
||||||
|
"CVE": "CVE-2021-41173",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(0|1|2|3|4|5|6|7|8)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious p2p message",
|
||||||
|
"uid": "GETH-2022-01",
|
||||||
|
"summary": "A vulnerable node can crash via p2p messages sent from an attacker node, if running with non-default log options.",
|
||||||
|
"description": "A vulnerable node, if configured to use high verbosity logging, can be made to crash when handling specially crafted p2p messages sent from an attacker node. Full details are available at the Github security [advisory](https://github.com/ethereum/go-ethereum/security/advisories/GHSA-wjxw-gh3m-7pm5)",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-wjxw-gh3m-7pm5",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities",
|
||||||
|
"https://github.com/ethereum/go-ethereum/pull/24507"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.10.17",
|
||||||
|
"published": "2022-05-11",
|
||||||
|
"severity": "Low",
|
||||||
|
"CVE": "CVE-2022-29177",
|
||||||
|
"check": "(Geth\\/v1\\.10\\.(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16)-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious p2p message",
|
||||||
|
"uid": "GETH-2023-01",
|
||||||
|
"summary": "A vulnerable node can be made to consume unbounded amounts of memory when handling specially crafted p2p messages sent from an attacker node.",
|
||||||
|
"description": "The p2p handler spawned a new goroutine to respond to ping requests. By flooding a node with ping requests, an unbounded number of goroutines can be created, leading to resource exhaustion and potentially crash due to OOM.",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-ppjg-v974-84cm",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.12.1",
|
||||||
|
"published": "2023-09-06",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2023-40591",
|
||||||
|
"check": "(Geth\\/v1\\.(10|11)\\..*)|(Geth\\/v1\\.12\\.0-.*)$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "DoS via malicious p2p message",
|
||||||
|
"uid": "GETH-2024-01",
|
||||||
|
"summary": "A vulnerable node can be made to consume very large amounts of memory when handling specially crafted p2p messages sent from an attacker node.",
|
||||||
|
"description": "A vulnerable node can be made to consume very large amounts of memory when handling specially crafted p2p messages sent from an attacker node. Full details will be available at the Github security [advisory](https://github.com/ethereum/go-ethereum/security/advisories/GHSA-4xc9-8hmq-j652)",
|
||||||
|
"links": [
|
||||||
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-4xc9-8hmq-j652",
|
||||||
|
"https://geth.ethereum.org/docs/vulnerabilities/vulnerabilities"
|
||||||
|
],
|
||||||
|
"introduced": "v1.10.0",
|
||||||
|
"fixed": "v1.13.15",
|
||||||
|
"published": "2024-05-06",
|
||||||
|
"severity": "High",
|
||||||
|
"CVE": "CVE-2024-32972",
|
||||||
|
"check": "(Geth\\/v1\\.(10|11|12)\\..*)|(Geth\\/v1\\.13\\.\\d-.*)|(Geth\\/v1\\.13\\.1(0|1|2|3|4)-.*)$"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: signature from minisign secret key
|
untrusted comment: signature from minisign secret key
|
||||||
RUQkliYstQBOKLK05Sy5f3bVRMBqJT26ABo6Vbp3BNJAVjejoqYCu4GWE/+7qcDfHBqYIniDCbFIUvYEnOHxV6vZ93wO1xJWDQw=
|
RUQkliYstQBOKHklFEYCUjepz81dyUuDmIAxjAvXa+icjGuKcjtVfV06G7qfOMSpplS5EcntU12n+AnGNyuOM8zIctaIWcfG2w0=
|
||||||
trusted comment: timestamp:1693986492 file:data.json hashed
|
trusted comment: timestamp:1752094689 file:data.json hashed
|
||||||
6Fdw2H+W1ZXK7QXSF77Z5AWC7+AEFAfDmTSxNGylU5HLT1AuSJQmxslj+VjtUBamYCvOuET7plbXza942AlWDw==
|
u2e4wo4HBTU6viQTSY/NVBHoWoPFJnnTvLZS0FYl3JdvSOYi6+qpbEsDhAIFqq/n8VmlS/fPqqf7vKCNiAgjAA==
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: signature from minisign secret key
|
untrusted comment: signature from minisign secret key
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
RWQkliYstQBOKNoyq2O98hPmeVJQ6ShQLM58+4n0gkY0y0trFMDAsHuN/l4IyHfh8dDQ1ry0+IuZVrf/i8M/P3YFzFfAymDYCQ0=
|
||||||
trusted comment: timestamp:1605618622 file:vulnerabilities.json
|
trusted comment: timestamp:1752094703 file:data.json
|
||||||
osAPs4QPdDkmiWQxqeMIzYv/b+ZGxJ+19Sbrk1Cpq4t2gHBT+lqFtwL3OCzKWWyjGRTmHfsVGBYpzEdPRQ0/BQ==
|
cNyq3ZGlqo785HtWODb9ejWqF0HhSeXuLGXzC7z1IhnDrBObWBJngYd3qBG1dQcYlHQ+bgB/On5mSyMFn4UoCQ==
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: Here's a comment
|
untrusted comment: Here's a comment
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
RWQkliYstQBOKNoyq2O98hPmeVJQ6ShQLM58+4n0gkY0y0trFMDAsHuN/l4IyHfh8dDQ1ry0+IuZVrf/i8M/P3YFzFfAymDYCQ0=
|
||||||
trusted comment: Here's a trusted comment
|
trusted comment: Here's a trusted comment
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
dL7lO8sqFFCOXJO/u8SgoDk2nlXGWPRDbOTJkChMbmtUp9PB7sG831basXkZ/0CQ/l/vG7AbPyMNEVZyJn5NCg==
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
untrusted comment: One more (untrusted) comment
|
untrusted comment: One more (untrusted™) comment
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
RWQkliYstQBOKNoyq2O98hPmeVJQ6ShQLM58+4n0gkY0y0trFMDAsHuN/l4IyHfh8dDQ1ry0+IuZVrf/i8M/P3YFzFfAymDYCQ0=
|
||||||
trusted comment: Here's a trusted comment
|
trusted comment: Here's a trusted comment
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
dL7lO8sqFFCOXJO/u8SgoDk2nlXGWPRDbOTJkChMbmtUp9PB7sG831basXkZ/0CQ/l/vG7AbPyMNEVZyJn5NCg==
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
untrusted comment: verify with ./signifykey.pub
|
untrusted comment: verify with signifykey.pub
|
||||||
RWSKLNhZb0KdAbhRUhW2LQZXdnwttu2SYhM9EuC4mMgOJB85h7/YIPupf8/ldTs4N8e9Y/fhgdY40q5LQpt5IFC62fq0v8U1/w8=
|
RWSKLNhZb0KdARbMcGN40hbHzKQYZDgDOFhEUT1YpzMnqre/mbKJ8td/HVlG03Am1YCszATiI0DbnljjTy4iNHYwqBfzrFUqUg0=
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
untrusted comment: signature from minisign secret key
|
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
|
||||||
trusted comment: timestamp:1605618622 file:vulnerabilities.json
|
|
||||||
osAPs4QPdDkmiWQxqeMIzYv/b+ZGxJ+19Sbrk1Cpq4t2gHBT+lqFtwL3OCzKWWyjGRTmHfsVGBYpzEdPRQ0/BQ==
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
untrusted comment: Here's a comment
|
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
|
||||||
trusted comment: Here's a trusted comment
|
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
untrusted comment: One more (untrusted) comment
|
|
||||||
RWQkliYstQBOKFQFQTjmCd6TPw07VZyWFSB3v4+1BM1kv8eHLE5FDy2OkPEqtdaL53xftlrHoJQie0uCcovdlSV8kpyxiLrxEQ0=
|
|
||||||
trusted comment: Here's a trusted comment
|
|
||||||
3CnkIuz9MEDa7uNyGZAbKZhuirwfiqm7E1uQHrd2SiO4Y8+Akw9vs052AyKw0s5nhbYHCZE2IMQdHNjKwxEGAQ==
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
"description": "A mining flaw could cause miners to erroneously calculate PoW, due to an index overflow, if DAG size is exceeding the maximum 32 bit unsigned value.\n\nThis occurred on the ETC chain on 2020-11-06. This is likely to trigger for ETH mainnet around block `11550000`/epoch `385`, slated to occur early January 2021.\n\nThis issue is relevant only for miners, non-mining nodes are unaffected, since non-mining nodes use a smaller verification cache instead of a full DAG.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://github.com/ethereum/go-ethereum/pull/21793",
|
"https://github.com/ethereum/go-ethereum/pull/21793",
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49",
|
"https://github.com/ethereum/go-ethereum/commit/567d41d9363706b4b13ce0903804e8acf214af49",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-v592-xf75-856p"
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-v592-xf75-856p"
|
||||||
],
|
],
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing, due to an underlying bug in Go (CVE-2020-28362) versions < `1.15.5`, or `<1.14.12`",
|
||||||
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
"description": "The DoS issue can be used to crash all Geth nodes during block processing, the effects of which would be that a major part of the Ethereum network went offline.\n\nOutside of Go-Ethereum, the issue is most likely relevant for all forks of Geth (such as TurboGeth or ETC’s core-geth) which is built with versions of Go which contains the vulnerability.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
"https://groups.google.com/g/golang-announce/c/NpBGTTmKzpM",
|
||||||
"https://github.com/golang/go/issues/42552",
|
"https://github.com/golang/go/issues/42552",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-m6gx-rhvj-fh52"
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-m6gx-rhvj-fh52"
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
"summary": "A consensus flaw in Geth, related to `datacopy` precompile",
|
||||||
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
"description": "Geth erroneously performed a 'shallow' copy when the precompiled `datacopy` (at `0x00...04`) was invoked. An attacker could deploy a contract that uses the shallow copy to corrupt the contents of the `RETURNDATA`, thus causing a consensus failure.",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-69v6-xc2j-r2jf"
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-69v6-xc2j-r2jf"
|
||||||
],
|
],
|
||||||
"introduced": "v1.9.7",
|
"introduced": "v1.9.7",
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
"summary": "A denial-of-service issue can be used to crash Geth nodes during block processing",
|
||||||
"description": "Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n",
|
"description": "Affected versions suffer from a vulnerability which can be exploited through the `MULMOD` operation, by specifying a modulo of `0`: `mulmod(a,b,0)`, causing a `panic` in the underlying library. \nThe crash was in the `uint256` library, where a buffer [underflowed](https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L442).\n\n\tif `d == 0`, `dLen` remains `0`\n\nand https://github.com/holiman/uint256/blob/4ce82e695c10ddad57215bdbeafb68b8c5df2c30/uint256.go#L451 will try to access index `[-1]`.\n\nThe `uint256` library was first merged in this [commit](https://github.com/ethereum/go-ethereum/commit/cf6674539c589f80031f3371a71c6a80addbe454), on 2020-06-08. \nExploiting this vulnerabilty would cause all vulnerable nodes to drop off the network. \n\nThe issue was brought to our attention through a [bug report](https://github.com/ethereum/go-ethereum/issues/21367), showing a `panic` occurring on sync from genesis on the Ropsten network.\n \nIt was estimated that the least obvious way to fix this would be to merge the fix into `uint256`, make a new release of that library and then update the geth-dependency.\n",
|
||||||
"links": [
|
"links": [
|
||||||
"https://blog.ethereum.org/2020/11/12/geth_security_release/",
|
"https://blog.ethereum.org/2020/11/12/geth-security-release",
|
||||||
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m",
|
"https://github.com/ethereum/go-ethereum/security/advisories/GHSA-jm5c-rv3w-w83m",
|
||||||
"https://github.com/holiman/uint256/releases/tag/v1.1.1",
|
"https://github.com/holiman/uint256/releases/tag/v1.1.1",
|
||||||
"https://github.com/holiman/uint256/pull/80",
|
"https://github.com/holiman/uint256/pull/80",
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,9 @@ func TestVerification(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// For this test, the pubkey is in testdata/vcheck/minisign.pub
|
// For this test, the pubkey is in testdata/vcheck/minisign.pub
|
||||||
// (the privkey is `minisign.sec`, if we want to expand this test. Password 'test' )
|
// (the privkey is `minisign.sec`, if we want to expand this test. Password 'test' )
|
||||||
|
// 1. `minisign -S -l -s ./minisign.sec -m data.json -x ./minisig-sigs/vulnerabilities.json.minisig.1 -c "signature from minisign secret key"`
|
||||||
|
// 2. `minisign -S -l -s ./minisign.sec -m vulnerabilities.json -x ./minisig-sigs/vulnerabilities.json.minisig.2 -c "Here's a comment" -t "Here's a trusted comment"`
|
||||||
|
// 3. minisign -S -l -s ./minisign.sec -m vulnerabilities.json -x ./minisig-sigs/vulnerabilities.json.minisig.3 -c "One more (untrusted™) comment" -t "Here's a trusted comment"
|
||||||
pub := "RWQkliYstQBOKOdtClfgC3IypIPX6TAmoEi7beZ4gyR3wsaezvqOMWsp"
|
pub := "RWQkliYstQBOKOdtClfgC3IypIPX6TAmoEi7beZ4gyR3wsaezvqOMWsp"
|
||||||
testVerification(t, pub, "./testdata/vcheck/minisig-sigs/")
|
testVerification(t, pub, "./testdata/vcheck/minisig-sigs/")
|
||||||
})
|
})
|
||||||
|
|
@ -43,7 +46,7 @@ func TestVerification(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
// For this test, the pubkey is in testdata/vcheck/minisign.pub
|
// For this test, the pubkey is in testdata/vcheck/minisign.pub
|
||||||
// (the privkey is `minisign.sec`, if we want to expand this test. Password 'test' )
|
// (the privkey is `minisign.sec`, if we want to expand this test. Password 'test' )
|
||||||
// `minisign -S -s ./minisign.sec -m data.json -x ./minisig-sigs-new/data.json.minisig`
|
// `minisign -S -s ./minisign.sec -m data.json -x ./minisig-sigs-new/data.json.minisig`
|
||||||
pub := "RWQkliYstQBOKOdtClfgC3IypIPX6TAmoEi7beZ4gyR3wsaezvqOMWsp"
|
pub := "RWQkliYstQBOKOdtClfgC3IypIPX6TAmoEi7beZ4gyR3wsaezvqOMWsp"
|
||||||
testVerification(t, pub, "./testdata/vcheck/minisig-sigs-new/")
|
testVerification(t, pub, "./testdata/vcheck/minisig-sigs-new/")
|
||||||
})
|
})
|
||||||
|
|
@ -53,6 +56,7 @@ func TestVerification(t *testing.T) {
|
||||||
t.Skip("This currently fails, minisign expects 4 lines of data, signify provides only 2")
|
t.Skip("This currently fails, minisign expects 4 lines of data, signify provides only 2")
|
||||||
// For this test, the pubkey is in testdata/vcheck/signifykey.pub
|
// For this test, the pubkey is in testdata/vcheck/signifykey.pub
|
||||||
// (the privkey is `signifykey.sec`, if we want to expand this test. Password 'test' )
|
// (the privkey is `signifykey.sec`, if we want to expand this test. Password 'test' )
|
||||||
|
// `signify -S -s signifykey.sec -m data.json -x ./signify-sigs/data.json.sig`
|
||||||
pub := "RWSKLNhZb0KdATtRT7mZC/bybI3t3+Hv/O2i3ye04Dq9fnT9slpZ1a2/"
|
pub := "RWSKLNhZb0KdATtRT7mZC/bybI3t3+Hv/O2i3ye04Dq9fnT9slpZ1a2/"
|
||||||
testVerification(t, pub, "./testdata/vcheck/signify-sigs/")
|
testVerification(t, pub, "./testdata/vcheck/signify-sigs/")
|
||||||
})
|
})
|
||||||
|
|
|
||||||
182
core/types/bal/bal.go
Normal file
182
core/types/bal/bal.go
Normal file
|
|
@ -0,0 +1,182 @@
|
||||||
|
// Copyright 2025 The go-ethereum Authors
|
||||||
|
// This file is part of the go-ethereum library.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package bal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"maps"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/holiman/uint256"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CodeChange contains the runtime bytecode deployed at an address and the
|
||||||
|
// transaction index where the deployment took place.
|
||||||
|
type CodeChange struct {
|
||||||
|
TxIndex uint16
|
||||||
|
Code []byte `json:"code,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConstructionAccountAccess contains post-block account state for mutations as well as
|
||||||
|
// all storage keys that were read during execution. It is used when building block
|
||||||
|
// access list during execution.
|
||||||
|
type ConstructionAccountAccess struct {
|
||||||
|
// StorageWrites is the post-state values of an account's storage slots
|
||||||
|
// that were modified in a block, keyed by the slot key and the tx index
|
||||||
|
// where the modification occurred.
|
||||||
|
StorageWrites map[common.Hash]map[uint16]common.Hash `json:"storageWrites,omitempty"`
|
||||||
|
|
||||||
|
// StorageReads is the set of slot keys that were accessed during block
|
||||||
|
// execution.
|
||||||
|
//
|
||||||
|
// Storage slots which are both read and written (with changed values)
|
||||||
|
// appear only in StorageWrites.
|
||||||
|
StorageReads map[common.Hash]struct{} `json:"storageReads,omitempty"`
|
||||||
|
|
||||||
|
// BalanceChanges contains the post-transaction balances of an account,
|
||||||
|
// keyed by transaction indices where it was changed.
|
||||||
|
BalanceChanges map[uint16]*uint256.Int `json:"balanceChanges,omitempty"`
|
||||||
|
|
||||||
|
// NonceChanges contains the post-state nonce values of an account keyed
|
||||||
|
// by tx index.
|
||||||
|
NonceChanges map[uint16]uint64 `json:"nonceChanges,omitempty"`
|
||||||
|
|
||||||
|
// CodeChange is only set for contract accounts which were deployed in
|
||||||
|
// the block.
|
||||||
|
CodeChange *CodeChange `json:"codeChange,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewConstructionAccountAccess initializes the account access object.
|
||||||
|
func NewConstructionAccountAccess() *ConstructionAccountAccess {
|
||||||
|
return &ConstructionAccountAccess{
|
||||||
|
StorageWrites: make(map[common.Hash]map[uint16]common.Hash),
|
||||||
|
StorageReads: make(map[common.Hash]struct{}),
|
||||||
|
BalanceChanges: make(map[uint16]*uint256.Int),
|
||||||
|
NonceChanges: make(map[uint16]uint64),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConstructionBlockAccessList contains post-block modified state and some state accessed
|
||||||
|
// in execution (account addresses and storage keys).
|
||||||
|
type ConstructionBlockAccessList struct {
|
||||||
|
Accounts map[common.Address]*ConstructionAccountAccess
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewConstructionBlockAccessList instantiates an empty access list.
|
||||||
|
func NewConstructionBlockAccessList() ConstructionBlockAccessList {
|
||||||
|
return ConstructionBlockAccessList{
|
||||||
|
Accounts: make(map[common.Address]*ConstructionAccountAccess),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccountRead records the address of an account that has been read during execution.
|
||||||
|
func (b *ConstructionBlockAccessList) AccountRead(addr common.Address) {
|
||||||
|
if _, ok := b.Accounts[addr]; !ok {
|
||||||
|
b.Accounts[addr] = NewConstructionAccountAccess()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// StorageRead records a storage key read during execution.
|
||||||
|
func (b *ConstructionBlockAccessList) StorageRead(address common.Address, key common.Hash) {
|
||||||
|
if _, ok := b.Accounts[address]; !ok {
|
||||||
|
b.Accounts[address] = NewConstructionAccountAccess()
|
||||||
|
}
|
||||||
|
if _, ok := b.Accounts[address].StorageWrites[key]; ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
b.Accounts[address].StorageReads[key] = struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// StorageWrite records the post-transaction value of a mutated storage slot.
|
||||||
|
// The storage slot is removed from the list of read slots.
|
||||||
|
func (b *ConstructionBlockAccessList) StorageWrite(txIdx uint16, address common.Address, key, value common.Hash) {
|
||||||
|
if _, ok := b.Accounts[address]; !ok {
|
||||||
|
b.Accounts[address] = NewConstructionAccountAccess()
|
||||||
|
}
|
||||||
|
if _, ok := b.Accounts[address].StorageWrites[key]; !ok {
|
||||||
|
b.Accounts[address].StorageWrites[key] = make(map[uint16]common.Hash)
|
||||||
|
}
|
||||||
|
b.Accounts[address].StorageWrites[key][txIdx] = value
|
||||||
|
|
||||||
|
delete(b.Accounts[address].StorageReads, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CodeChange records the code of a newly-created contract.
|
||||||
|
func (b *ConstructionBlockAccessList) CodeChange(address common.Address, txIndex uint16, code []byte) {
|
||||||
|
if _, ok := b.Accounts[address]; !ok {
|
||||||
|
b.Accounts[address] = NewConstructionAccountAccess()
|
||||||
|
}
|
||||||
|
b.Accounts[address].CodeChange = &CodeChange{
|
||||||
|
TxIndex: txIndex,
|
||||||
|
Code: bytes.Clone(code),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// NonceChange records tx post-state nonce of any contract-like accounts whose
|
||||||
|
// nonce was incremented.
|
||||||
|
func (b *ConstructionBlockAccessList) NonceChange(address common.Address, txIdx uint16, postNonce uint64) {
|
||||||
|
if _, ok := b.Accounts[address]; !ok {
|
||||||
|
b.Accounts[address] = NewConstructionAccountAccess()
|
||||||
|
}
|
||||||
|
b.Accounts[address].NonceChanges[txIdx] = postNonce
|
||||||
|
}
|
||||||
|
|
||||||
|
// BalanceChange records the post-transaction balance of an account whose
|
||||||
|
// balance changed.
|
||||||
|
func (b *ConstructionBlockAccessList) BalanceChange(txIdx uint16, address common.Address, balance *uint256.Int) {
|
||||||
|
if _, ok := b.Accounts[address]; !ok {
|
||||||
|
b.Accounts[address] = NewConstructionAccountAccess()
|
||||||
|
}
|
||||||
|
b.Accounts[address].BalanceChanges[txIdx] = balance.Clone()
|
||||||
|
}
|
||||||
|
|
||||||
|
// PrettyPrint returns a human-readable representation of the access list
|
||||||
|
func (b *ConstructionBlockAccessList) PrettyPrint() string {
|
||||||
|
enc := b.toEncodingObj()
|
||||||
|
return enc.PrettyPrint()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy returns a deep copy of the access list.
|
||||||
|
func (b *ConstructionBlockAccessList) Copy() *ConstructionBlockAccessList {
|
||||||
|
res := NewConstructionBlockAccessList()
|
||||||
|
for addr, aa := range b.Accounts {
|
||||||
|
var aaCopy ConstructionAccountAccess
|
||||||
|
|
||||||
|
slotWrites := make(map[common.Hash]map[uint16]common.Hash, len(aa.StorageWrites))
|
||||||
|
for key, m := range aa.StorageWrites {
|
||||||
|
slotWrites[key] = maps.Clone(m)
|
||||||
|
}
|
||||||
|
aaCopy.StorageWrites = slotWrites
|
||||||
|
aaCopy.StorageReads = maps.Clone(aa.StorageReads)
|
||||||
|
|
||||||
|
balances := make(map[uint16]*uint256.Int, len(aa.BalanceChanges))
|
||||||
|
for index, balance := range aa.BalanceChanges {
|
||||||
|
balances[index] = balance.Clone()
|
||||||
|
}
|
||||||
|
aaCopy.BalanceChanges = balances
|
||||||
|
aaCopy.NonceChanges = maps.Clone(aa.NonceChanges)
|
||||||
|
|
||||||
|
if aa.CodeChange != nil {
|
||||||
|
aaCopy.CodeChange = &CodeChange{
|
||||||
|
TxIndex: aa.CodeChange.TxIndex,
|
||||||
|
Code: bytes.Clone(aa.CodeChange.Code),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.Accounts[addr] = &aaCopy
|
||||||
|
}
|
||||||
|
return &res
|
||||||
|
}
|
||||||
344
core/types/bal/bal_encoding.go
Normal file
344
core/types/bal/bal_encoding.go
Normal file
|
|
@ -0,0 +1,344 @@
|
||||||
|
// Copyright 2025 The go-ethereum Authors
|
||||||
|
// This file is part of the go-ethereum library.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package bal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"cmp"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"maps"
|
||||||
|
"slices"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
|
"github.com/ethereum/go-ethereum/params"
|
||||||
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
|
"github.com/holiman/uint256"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:generate go run github.com/ethereum/go-ethereum/rlp/rlpgen -out bal_encoding_rlp_generated.go -type BlockAccessList -decoder
|
||||||
|
|
||||||
|
// These are objects used as input for the access list encoding. They mirror
|
||||||
|
// the spec format.
|
||||||
|
|
||||||
|
// BlockAccessList is the encoding format of ConstructionBlockAccessList.
|
||||||
|
type BlockAccessList struct {
|
||||||
|
Accesses []AccountAccess `ssz-max:"300000"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate returns an error if the contents of the access list are not ordered
|
||||||
|
// according to the spec or any code changes are contained which exceed protocol
|
||||||
|
// max code size.
|
||||||
|
func (e *BlockAccessList) Validate() error {
|
||||||
|
if !slices.IsSortedFunc(e.Accesses, func(a, b AccountAccess) int {
|
||||||
|
return bytes.Compare(a.Address[:], b.Address[:])
|
||||||
|
}) {
|
||||||
|
return errors.New("block access list accounts not in lexicographic order")
|
||||||
|
}
|
||||||
|
for _, entry := range e.Accesses {
|
||||||
|
if err := entry.validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hash computes the keccak256 hash of the access list
|
||||||
|
func (e *BlockAccessList) Hash() common.Hash {
|
||||||
|
var enc bytes.Buffer
|
||||||
|
err := e.EncodeRLP(&enc)
|
||||||
|
if err != nil {
|
||||||
|
// errors here are related to BAL values exceeding maximum size defined
|
||||||
|
// by the spec. Hard-fail because these cases are not expected to be hit
|
||||||
|
// under reasonable conditions.
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return crypto.Keccak256Hash(enc.Bytes())
|
||||||
|
}
|
||||||
|
|
||||||
|
// encodeBalance encodes the provided balance into 16-bytes.
|
||||||
|
func encodeBalance(val *uint256.Int) [16]byte {
|
||||||
|
valBytes := val.Bytes()
|
||||||
|
if len(valBytes) > 16 {
|
||||||
|
panic("can't encode value that is greater than 16 bytes in size")
|
||||||
|
}
|
||||||
|
var enc [16]byte
|
||||||
|
copy(enc[16-len(valBytes):], valBytes[:])
|
||||||
|
return enc
|
||||||
|
}
|
||||||
|
|
||||||
|
// encodingBalanceChange is the encoding format of BalanceChange.
|
||||||
|
type encodingBalanceChange struct {
|
||||||
|
TxIdx uint16 `ssz-size:"2"`
|
||||||
|
Balance [16]byte `ssz-size:"16"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// encodingAccountNonce is the encoding format of NonceChange.
|
||||||
|
type encodingAccountNonce struct {
|
||||||
|
TxIdx uint16 `ssz-size:"2"`
|
||||||
|
Nonce uint64 `ssz-size:"8"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// encodingStorageWrite is the encoding format of StorageWrites.
|
||||||
|
type encodingStorageWrite struct {
|
||||||
|
TxIdx uint16
|
||||||
|
ValueAfter [32]byte `ssz-size:"32"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// encodingStorageWrite is the encoding format of SlotWrites.
|
||||||
|
type encodingSlotWrites struct {
|
||||||
|
Slot [32]byte `ssz-size:"32"`
|
||||||
|
Accesses []encodingStorageWrite `ssz-max:"300000"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate returns an instance of the encoding-representation slot writes in
|
||||||
|
// working representation.
|
||||||
|
func (e *encodingSlotWrites) validate() error {
|
||||||
|
if slices.IsSortedFunc(e.Accesses, func(a, b encodingStorageWrite) int {
|
||||||
|
return cmp.Compare[uint16](a.TxIdx, b.TxIdx)
|
||||||
|
}) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return errors.New("storage write tx indices not in order")
|
||||||
|
}
|
||||||
|
|
||||||
|
// AccountAccess is the encoding format of ConstructionAccountAccess.
|
||||||
|
type AccountAccess struct {
|
||||||
|
Address [20]byte `ssz-size:"20"` // 20-byte Ethereum address
|
||||||
|
StorageWrites []encodingSlotWrites `ssz-max:"300000"` // Storage changes (slot -> [tx_index -> new_value])
|
||||||
|
StorageReads [][32]byte `ssz-max:"300000"` // Read-only storage keys
|
||||||
|
BalanceChanges []encodingBalanceChange `ssz-max:"300000"` // Balance changes ([tx_index -> post_balance])
|
||||||
|
NonceChanges []encodingAccountNonce `ssz-max:"300000"` // Nonce changes ([tx_index -> new_nonce])
|
||||||
|
Code []CodeChange `ssz-max:"1"` // Code changes ([tx_index -> new_code])
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate converts the account accesses out of encoding format.
|
||||||
|
// If any of the keys in the encoding object are not ordered according to the
|
||||||
|
// spec, an error is returned.
|
||||||
|
func (e *AccountAccess) validate() error {
|
||||||
|
// Check the storage write slots are sorted in order
|
||||||
|
if !slices.IsSortedFunc(e.StorageWrites, func(a, b encodingSlotWrites) int {
|
||||||
|
return bytes.Compare(a.Slot[:], b.Slot[:])
|
||||||
|
}) {
|
||||||
|
return errors.New("storage writes slots not in lexicographic order")
|
||||||
|
}
|
||||||
|
for _, write := range e.StorageWrites {
|
||||||
|
if err := write.validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the storage read slots are sorted in order
|
||||||
|
if !slices.IsSortedFunc(e.StorageReads, func(a, b [32]byte) int {
|
||||||
|
return bytes.Compare(a[:], b[:])
|
||||||
|
}) {
|
||||||
|
return errors.New("storage read slots not in lexicographic order")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the balance changes are sorted in order
|
||||||
|
if !slices.IsSortedFunc(e.BalanceChanges, func(a, b encodingBalanceChange) int {
|
||||||
|
return cmp.Compare[uint16](a.TxIdx, b.TxIdx)
|
||||||
|
}) {
|
||||||
|
return errors.New("balance changes not in ascending order by tx index")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the nonce changes are sorted in order
|
||||||
|
if !slices.IsSortedFunc(e.NonceChanges, func(a, b encodingAccountNonce) int {
|
||||||
|
return cmp.Compare[uint16](a.TxIdx, b.TxIdx)
|
||||||
|
}) {
|
||||||
|
return errors.New("nonce changes not in ascending order by tx index")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert code change
|
||||||
|
if len(e.Code) == 1 {
|
||||||
|
if len(e.Code[0].Code) > params.MaxCodeSize {
|
||||||
|
return fmt.Errorf("code change contained oversized code")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy returns a deep copy of the account access
|
||||||
|
func (e *AccountAccess) Copy() AccountAccess {
|
||||||
|
res := AccountAccess{
|
||||||
|
Address: e.Address,
|
||||||
|
StorageReads: slices.Clone(e.StorageReads),
|
||||||
|
BalanceChanges: slices.Clone(e.BalanceChanges),
|
||||||
|
NonceChanges: slices.Clone(e.NonceChanges),
|
||||||
|
}
|
||||||
|
for _, storageWrite := range e.StorageWrites {
|
||||||
|
res.StorageWrites = append(res.StorageWrites, encodingSlotWrites{
|
||||||
|
Slot: storageWrite.Slot,
|
||||||
|
Accesses: slices.Clone(storageWrite.Accesses),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if len(e.Code) == 1 {
|
||||||
|
res.Code = []CodeChange{
|
||||||
|
{
|
||||||
|
e.Code[0].TxIndex,
|
||||||
|
bytes.Clone(e.Code[0].Code),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
// EncodeRLP returns the RLP-encoded access list
|
||||||
|
func (b *ConstructionBlockAccessList) EncodeRLP(wr io.Writer) error {
|
||||||
|
return b.toEncodingObj().EncodeRLP(wr)
|
||||||
|
}
|
||||||
|
|
||||||
|
var _ rlp.Encoder = &ConstructionBlockAccessList{}
|
||||||
|
|
||||||
|
// toEncodingObj creates an instance of the ConstructionAccountAccess of the type that is
|
||||||
|
// used as input for the encoding.
|
||||||
|
func (a *ConstructionAccountAccess) toEncodingObj(addr common.Address) AccountAccess {
|
||||||
|
res := AccountAccess{
|
||||||
|
Address: addr,
|
||||||
|
StorageWrites: make([]encodingSlotWrites, 0),
|
||||||
|
StorageReads: make([][32]byte, 0),
|
||||||
|
BalanceChanges: make([]encodingBalanceChange, 0),
|
||||||
|
NonceChanges: make([]encodingAccountNonce, 0),
|
||||||
|
Code: nil,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert write slots
|
||||||
|
writeSlots := slices.Collect(maps.Keys(a.StorageWrites))
|
||||||
|
slices.SortFunc(writeSlots, common.Hash.Cmp)
|
||||||
|
for _, slot := range writeSlots {
|
||||||
|
var obj encodingSlotWrites
|
||||||
|
obj.Slot = slot
|
||||||
|
|
||||||
|
slotWrites := a.StorageWrites[slot]
|
||||||
|
obj.Accesses = make([]encodingStorageWrite, 0, len(slotWrites))
|
||||||
|
|
||||||
|
indices := slices.Collect(maps.Keys(slotWrites))
|
||||||
|
slices.SortFunc(indices, cmp.Compare[uint16])
|
||||||
|
for _, index := range indices {
|
||||||
|
obj.Accesses = append(obj.Accesses, encodingStorageWrite{
|
||||||
|
TxIdx: index,
|
||||||
|
ValueAfter: slotWrites[index],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
res.StorageWrites = append(res.StorageWrites, obj)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert read slots
|
||||||
|
readSlots := slices.Collect(maps.Keys(a.StorageReads))
|
||||||
|
slices.SortFunc(readSlots, common.Hash.Cmp)
|
||||||
|
for _, slot := range readSlots {
|
||||||
|
res.StorageReads = append(res.StorageReads, slot)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert balance changes
|
||||||
|
balanceIndices := slices.Collect(maps.Keys(a.BalanceChanges))
|
||||||
|
slices.SortFunc(balanceIndices, cmp.Compare[uint16])
|
||||||
|
for _, idx := range balanceIndices {
|
||||||
|
res.BalanceChanges = append(res.BalanceChanges, encodingBalanceChange{
|
||||||
|
TxIdx: idx,
|
||||||
|
Balance: encodeBalance(a.BalanceChanges[idx]),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert nonce changes
|
||||||
|
nonceIndices := slices.Collect(maps.Keys(a.NonceChanges))
|
||||||
|
slices.SortFunc(nonceIndices, cmp.Compare[uint16])
|
||||||
|
for _, idx := range nonceIndices {
|
||||||
|
res.NonceChanges = append(res.NonceChanges, encodingAccountNonce{
|
||||||
|
TxIdx: idx,
|
||||||
|
Nonce: a.NonceChanges[idx],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert code change
|
||||||
|
if a.CodeChange != nil {
|
||||||
|
res.Code = []CodeChange{
|
||||||
|
{
|
||||||
|
a.CodeChange.TxIndex,
|
||||||
|
bytes.Clone(a.CodeChange.Code),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
// toEncodingObj returns an instance of the access list expressed as the type
|
||||||
|
// which is used as input for the encoding/decoding.
|
||||||
|
func (b *ConstructionBlockAccessList) toEncodingObj() *BlockAccessList {
|
||||||
|
var addresses []common.Address
|
||||||
|
for addr := range b.Accounts {
|
||||||
|
addresses = append(addresses, addr)
|
||||||
|
}
|
||||||
|
slices.SortFunc(addresses, common.Address.Cmp)
|
||||||
|
|
||||||
|
var res BlockAccessList
|
||||||
|
for _, addr := range addresses {
|
||||||
|
res.Accesses = append(res.Accesses, b.Accounts[addr].toEncodingObj(addr))
|
||||||
|
}
|
||||||
|
return &res
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *BlockAccessList) PrettyPrint() string {
|
||||||
|
var res bytes.Buffer
|
||||||
|
printWithIndent := func(indent int, text string) {
|
||||||
|
fmt.Fprintf(&res, "%s%s\n", strings.Repeat(" ", indent), text)
|
||||||
|
}
|
||||||
|
for _, accountDiff := range e.Accesses {
|
||||||
|
printWithIndent(0, fmt.Sprintf("%x:", accountDiff.Address))
|
||||||
|
|
||||||
|
printWithIndent(1, "storage writes:")
|
||||||
|
for _, sWrite := range accountDiff.StorageWrites {
|
||||||
|
printWithIndent(2, fmt.Sprintf("%x:", sWrite.Slot))
|
||||||
|
for _, access := range sWrite.Accesses {
|
||||||
|
printWithIndent(3, fmt.Sprintf("%d: %x", access.TxIdx, access.ValueAfter))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printWithIndent(1, "storage reads:")
|
||||||
|
for _, slot := range accountDiff.StorageReads {
|
||||||
|
printWithIndent(2, fmt.Sprintf("%x", slot))
|
||||||
|
}
|
||||||
|
|
||||||
|
printWithIndent(1, "balance changes:")
|
||||||
|
for _, change := range accountDiff.BalanceChanges {
|
||||||
|
balance := new(uint256.Int).SetBytes(change.Balance[:]).String()
|
||||||
|
printWithIndent(2, fmt.Sprintf("%d: %s", change.TxIdx, balance))
|
||||||
|
}
|
||||||
|
|
||||||
|
printWithIndent(1, "nonce changes:")
|
||||||
|
for _, change := range accountDiff.NonceChanges {
|
||||||
|
printWithIndent(2, fmt.Sprintf("%d: %d", change.TxIdx, change.Nonce))
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(accountDiff.Code) > 0 {
|
||||||
|
printWithIndent(1, "code:")
|
||||||
|
printWithIndent(2, fmt.Sprintf("%d: %x", accountDiff.Code[0].TxIndex, accountDiff.Code[0].Code))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy returns a deep copy of the access list
|
||||||
|
func (e *BlockAccessList) Copy() (res BlockAccessList) {
|
||||||
|
for _, accountAccess := range e.Accesses {
|
||||||
|
res.Accesses = append(res.Accesses, accountAccess.Copy())
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
280
core/types/bal/bal_encoding_rlp_generated.go
Normal file
280
core/types/bal/bal_encoding_rlp_generated.go
Normal file
|
|
@ -0,0 +1,280 @@
|
||||||
|
// Code generated by rlpgen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package bal
|
||||||
|
|
||||||
|
import "github.com/ethereum/go-ethereum/rlp"
|
||||||
|
import "io"
|
||||||
|
|
||||||
|
func (obj *BlockAccessList) EncodeRLP(_w io.Writer) error {
|
||||||
|
w := rlp.NewEncoderBuffer(_w)
|
||||||
|
_tmp0 := w.List()
|
||||||
|
_tmp1 := w.List()
|
||||||
|
for _, _tmp2 := range obj.Accesses {
|
||||||
|
_tmp3 := w.List()
|
||||||
|
w.WriteBytes(_tmp2.Address[:])
|
||||||
|
_tmp4 := w.List()
|
||||||
|
for _, _tmp5 := range _tmp2.StorageWrites {
|
||||||
|
_tmp6 := w.List()
|
||||||
|
w.WriteBytes(_tmp5.Slot[:])
|
||||||
|
_tmp7 := w.List()
|
||||||
|
for _, _tmp8 := range _tmp5.Accesses {
|
||||||
|
_tmp9 := w.List()
|
||||||
|
w.WriteUint64(uint64(_tmp8.TxIdx))
|
||||||
|
w.WriteBytes(_tmp8.ValueAfter[:])
|
||||||
|
w.ListEnd(_tmp9)
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp7)
|
||||||
|
w.ListEnd(_tmp6)
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp4)
|
||||||
|
_tmp10 := w.List()
|
||||||
|
for _, _tmp11 := range _tmp2.StorageReads {
|
||||||
|
w.WriteBytes(_tmp11[:])
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp10)
|
||||||
|
_tmp12 := w.List()
|
||||||
|
for _, _tmp13 := range _tmp2.BalanceChanges {
|
||||||
|
_tmp14 := w.List()
|
||||||
|
w.WriteUint64(uint64(_tmp13.TxIdx))
|
||||||
|
w.WriteBytes(_tmp13.Balance[:])
|
||||||
|
w.ListEnd(_tmp14)
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp12)
|
||||||
|
_tmp15 := w.List()
|
||||||
|
for _, _tmp16 := range _tmp2.NonceChanges {
|
||||||
|
_tmp17 := w.List()
|
||||||
|
w.WriteUint64(uint64(_tmp16.TxIdx))
|
||||||
|
w.WriteUint64(_tmp16.Nonce)
|
||||||
|
w.ListEnd(_tmp17)
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp15)
|
||||||
|
_tmp18 := w.List()
|
||||||
|
for _, _tmp19 := range _tmp2.Code {
|
||||||
|
_tmp20 := w.List()
|
||||||
|
w.WriteUint64(uint64(_tmp19.TxIndex))
|
||||||
|
w.WriteBytes(_tmp19.Code)
|
||||||
|
w.ListEnd(_tmp20)
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp18)
|
||||||
|
w.ListEnd(_tmp3)
|
||||||
|
}
|
||||||
|
w.ListEnd(_tmp1)
|
||||||
|
w.ListEnd(_tmp0)
|
||||||
|
return w.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (obj *BlockAccessList) DecodeRLP(dec *rlp.Stream) error {
|
||||||
|
var _tmp0 BlockAccessList
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// Accesses:
|
||||||
|
var _tmp1 []AccountAccess
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp2 AccountAccess
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// Address:
|
||||||
|
var _tmp3 [20]byte
|
||||||
|
if err := dec.ReadBytes(_tmp3[:]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp2.Address = _tmp3
|
||||||
|
// StorageWrites:
|
||||||
|
var _tmp4 []encodingSlotWrites
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp5 encodingSlotWrites
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// Slot:
|
||||||
|
var _tmp6 [32]byte
|
||||||
|
if err := dec.ReadBytes(_tmp6[:]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp5.Slot = _tmp6
|
||||||
|
// Accesses:
|
||||||
|
var _tmp7 []encodingStorageWrite
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp8 encodingStorageWrite
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// TxIdx:
|
||||||
|
_tmp9, err := dec.Uint16()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp8.TxIdx = _tmp9
|
||||||
|
// ValueAfter:
|
||||||
|
var _tmp10 [32]byte
|
||||||
|
if err := dec.ReadBytes(_tmp10[:]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp8.ValueAfter = _tmp10
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tmp7 = append(_tmp7, _tmp8)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp5.Accesses = _tmp7
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tmp4 = append(_tmp4, _tmp5)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp2.StorageWrites = _tmp4
|
||||||
|
// StorageReads:
|
||||||
|
var _tmp11 [][32]byte
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp12 [32]byte
|
||||||
|
if err := dec.ReadBytes(_tmp12[:]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp11 = append(_tmp11, _tmp12)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp2.StorageReads = _tmp11
|
||||||
|
// BalanceChanges:
|
||||||
|
var _tmp13 []encodingBalanceChange
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp14 encodingBalanceChange
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// TxIdx:
|
||||||
|
_tmp15, err := dec.Uint16()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp14.TxIdx = _tmp15
|
||||||
|
// Balance:
|
||||||
|
var _tmp16 [16]byte
|
||||||
|
if err := dec.ReadBytes(_tmp16[:]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp14.Balance = _tmp16
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tmp13 = append(_tmp13, _tmp14)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp2.BalanceChanges = _tmp13
|
||||||
|
// NonceChanges:
|
||||||
|
var _tmp17 []encodingAccountNonce
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp18 encodingAccountNonce
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// TxIdx:
|
||||||
|
_tmp19, err := dec.Uint16()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp18.TxIdx = _tmp19
|
||||||
|
// Nonce:
|
||||||
|
_tmp20, err := dec.Uint64()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp18.Nonce = _tmp20
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tmp17 = append(_tmp17, _tmp18)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp2.NonceChanges = _tmp17
|
||||||
|
// Code:
|
||||||
|
var _tmp21 []CodeChange
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
for dec.MoreDataInList() {
|
||||||
|
var _tmp22 CodeChange
|
||||||
|
{
|
||||||
|
if _, err := dec.List(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
// TxIndex:
|
||||||
|
_tmp23, err := dec.Uint16()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp22.TxIndex = _tmp23
|
||||||
|
// Code:
|
||||||
|
_tmp24, err := dec.Bytes()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp22.Code = _tmp24
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tmp21 = append(_tmp21, _tmp22)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp2.Code = _tmp21
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_tmp1 = append(_tmp1, _tmp2)
|
||||||
|
}
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_tmp0.Accesses = _tmp1
|
||||||
|
if err := dec.ListEnd(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*obj = _tmp0
|
||||||
|
return nil
|
||||||
|
}
|
||||||
252
core/types/bal/bal_test.go
Normal file
252
core/types/bal/bal_test.go
Normal file
|
|
@ -0,0 +1,252 @@
|
||||||
|
// Copyright 2025 The go-ethereum Authors
|
||||||
|
// This file is part of the go-ethereum library.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
package bal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"cmp"
|
||||||
|
"reflect"
|
||||||
|
"slices"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
"github.com/ethereum/go-ethereum/internal/testrand"
|
||||||
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
|
"github.com/holiman/uint256"
|
||||||
|
)
|
||||||
|
|
||||||
|
func equalBALs(a *BlockAccessList, b *BlockAccessList) bool {
|
||||||
|
if !reflect.DeepEqual(a, b) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTestConstructionBAL() *ConstructionBlockAccessList {
|
||||||
|
return &ConstructionBlockAccessList{
|
||||||
|
map[common.Address]*ConstructionAccountAccess{
|
||||||
|
common.BytesToAddress([]byte{0xff, 0xff}): {
|
||||||
|
StorageWrites: map[common.Hash]map[uint16]common.Hash{
|
||||||
|
common.BytesToHash([]byte{0x01}): {
|
||||||
|
1: common.BytesToHash([]byte{1, 2, 3, 4}),
|
||||||
|
2: common.BytesToHash([]byte{1, 2, 3, 4, 5, 6}),
|
||||||
|
},
|
||||||
|
common.BytesToHash([]byte{0x10}): {
|
||||||
|
20: common.BytesToHash([]byte{1, 2, 3, 4}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
StorageReads: map[common.Hash]struct{}{
|
||||||
|
common.BytesToHash([]byte{1, 2, 3, 4, 5, 6, 7}): {},
|
||||||
|
},
|
||||||
|
BalanceChanges: map[uint16]*uint256.Int{
|
||||||
|
1: uint256.NewInt(100),
|
||||||
|
2: uint256.NewInt(500),
|
||||||
|
},
|
||||||
|
NonceChanges: map[uint16]uint64{
|
||||||
|
1: 2,
|
||||||
|
2: 6,
|
||||||
|
},
|
||||||
|
CodeChange: &CodeChange{
|
||||||
|
TxIndex: 0,
|
||||||
|
Code: common.Hex2Bytes("deadbeef"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
common.BytesToAddress([]byte{0xff, 0xff, 0xff}): {
|
||||||
|
StorageWrites: map[common.Hash]map[uint16]common.Hash{
|
||||||
|
common.BytesToHash([]byte{0x01}): {
|
||||||
|
2: common.BytesToHash([]byte{1, 2, 3, 4, 5, 6}),
|
||||||
|
3: common.BytesToHash([]byte{1, 2, 3, 4, 5, 6, 7, 8}),
|
||||||
|
},
|
||||||
|
common.BytesToHash([]byte{0x10}): {
|
||||||
|
21: common.BytesToHash([]byte{1, 2, 3, 4, 5}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
StorageReads: map[common.Hash]struct{}{
|
||||||
|
common.BytesToHash([]byte{1, 2, 3, 4, 5, 6, 7, 8}): {},
|
||||||
|
},
|
||||||
|
BalanceChanges: map[uint16]*uint256.Int{
|
||||||
|
2: uint256.NewInt(100),
|
||||||
|
3: uint256.NewInt(500),
|
||||||
|
},
|
||||||
|
NonceChanges: map[uint16]uint64{
|
||||||
|
1: 2,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TestBALEncoding tests that a populated access list can be encoded/decoded correctly.
|
||||||
|
func TestBALEncoding(t *testing.T) {
|
||||||
|
var buf bytes.Buffer
|
||||||
|
bal := makeTestConstructionBAL()
|
||||||
|
err := bal.EncodeRLP(&buf)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("encoding failed: %v\n", err)
|
||||||
|
}
|
||||||
|
var dec BlockAccessList
|
||||||
|
if err := dec.DecodeRLP(rlp.NewStream(bytes.NewReader(buf.Bytes()), 10000000)); err != nil {
|
||||||
|
t.Fatalf("decoding failed: %v\n", err)
|
||||||
|
}
|
||||||
|
if dec.Hash() != bal.toEncodingObj().Hash() {
|
||||||
|
t.Fatalf("encoded block hash doesn't match decoded")
|
||||||
|
}
|
||||||
|
if !equalBALs(bal.toEncodingObj(), &dec) {
|
||||||
|
t.Fatal("decoded BAL doesn't match")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTestAccountAccess(sort bool) AccountAccess {
|
||||||
|
var (
|
||||||
|
storageWrites []encodingSlotWrites
|
||||||
|
storageReads [][32]byte
|
||||||
|
balances []encodingBalanceChange
|
||||||
|
nonces []encodingAccountNonce
|
||||||
|
)
|
||||||
|
for i := 0; i < 5; i++ {
|
||||||
|
slot := encodingSlotWrites{
|
||||||
|
Slot: testrand.Hash(),
|
||||||
|
}
|
||||||
|
for j := 0; j < 3; j++ {
|
||||||
|
slot.Accesses = append(slot.Accesses, encodingStorageWrite{
|
||||||
|
TxIdx: uint16(2 * j),
|
||||||
|
ValueAfter: testrand.Hash(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if sort {
|
||||||
|
slices.SortFunc(slot.Accesses, func(a, b encodingStorageWrite) int {
|
||||||
|
return cmp.Compare[uint16](a.TxIdx, b.TxIdx)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
storageWrites = append(storageWrites, slot)
|
||||||
|
}
|
||||||
|
if sort {
|
||||||
|
slices.SortFunc(storageWrites, func(a, b encodingSlotWrites) int {
|
||||||
|
return bytes.Compare(a.Slot[:], b.Slot[:])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < 5; i++ {
|
||||||
|
storageReads = append(storageReads, testrand.Hash())
|
||||||
|
}
|
||||||
|
if sort {
|
||||||
|
slices.SortFunc(storageReads, func(a, b [32]byte) int {
|
||||||
|
return bytes.Compare(a[:], b[:])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < 5; i++ {
|
||||||
|
balances = append(balances, encodingBalanceChange{
|
||||||
|
TxIdx: uint16(2 * i),
|
||||||
|
Balance: [16]byte(testrand.Bytes(16)),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if sort {
|
||||||
|
slices.SortFunc(balances, func(a, b encodingBalanceChange) int {
|
||||||
|
return cmp.Compare[uint16](a.TxIdx, b.TxIdx)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := 0; i < 5; i++ {
|
||||||
|
nonces = append(nonces, encodingAccountNonce{
|
||||||
|
TxIdx: uint16(2 * i),
|
||||||
|
Nonce: uint64(i + 100),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if sort {
|
||||||
|
slices.SortFunc(nonces, func(a, b encodingAccountNonce) int {
|
||||||
|
return cmp.Compare[uint16](a.TxIdx, b.TxIdx)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return AccountAccess{
|
||||||
|
Address: [20]byte(testrand.Bytes(20)),
|
||||||
|
StorageWrites: storageWrites,
|
||||||
|
StorageReads: storageReads,
|
||||||
|
BalanceChanges: balances,
|
||||||
|
NonceChanges: nonces,
|
||||||
|
Code: []CodeChange{
|
||||||
|
{
|
||||||
|
TxIndex: 100,
|
||||||
|
Code: testrand.Bytes(256),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeTestBAL(sort bool) BlockAccessList {
|
||||||
|
list := BlockAccessList{}
|
||||||
|
for i := 0; i < 5; i++ {
|
||||||
|
list.Accesses = append(list.Accesses, makeTestAccountAccess(sort))
|
||||||
|
}
|
||||||
|
if sort {
|
||||||
|
slices.SortFunc(list.Accesses, func(a, b AccountAccess) int {
|
||||||
|
return bytes.Compare(a.Address[:], b.Address[:])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestBlockAccessListCopy(t *testing.T) {
|
||||||
|
list := makeTestBAL(true)
|
||||||
|
cpy := list.Copy()
|
||||||
|
cpyCpy := cpy.Copy()
|
||||||
|
|
||||||
|
if !reflect.DeepEqual(list, cpy) {
|
||||||
|
t.Fatal("block access mismatch")
|
||||||
|
}
|
||||||
|
if !reflect.DeepEqual(cpy, cpyCpy) {
|
||||||
|
t.Fatal("block access mismatch")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure the mutations on copy won't affect the origin
|
||||||
|
for _, aa := range cpyCpy.Accesses {
|
||||||
|
for i := 0; i < len(aa.StorageReads); i++ {
|
||||||
|
aa.StorageReads[i] = [32]byte(testrand.Bytes(32))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !reflect.DeepEqual(list, cpy) {
|
||||||
|
t.Fatal("block access mismatch")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestBlockAccessListValidation(t *testing.T) {
|
||||||
|
// Validate the block access list after RLP decoding
|
||||||
|
enc := makeTestBAL(true)
|
||||||
|
if err := enc.Validate(); err != nil {
|
||||||
|
t.Fatalf("Unexpected validation error: %v", err)
|
||||||
|
}
|
||||||
|
var buf bytes.Buffer
|
||||||
|
if err := enc.EncodeRLP(&buf); err != nil {
|
||||||
|
t.Fatalf("Unexpected encoding error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
var dec BlockAccessList
|
||||||
|
if err := dec.DecodeRLP(rlp.NewStream(bytes.NewReader(buf.Bytes()), 0)); err != nil {
|
||||||
|
t.Fatalf("Unexpected RLP-decode error: %v", err)
|
||||||
|
}
|
||||||
|
if err := dec.Validate(); err != nil {
|
||||||
|
t.Fatalf("Unexpected validation error: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate the derived block access list
|
||||||
|
cBAL := makeTestConstructionBAL()
|
||||||
|
listB := cBAL.toEncodingObj()
|
||||||
|
if err := listB.Validate(); err != nil {
|
||||||
|
t.Fatalf("Unexpected validation error: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -535,9 +535,15 @@ func (d *Downloader) syncToHead() (err error) {
|
||||||
|
|
||||||
// If a part of blockchain data has already been written into active store,
|
// If a part of blockchain data has already been written into active store,
|
||||||
// disable the ancient style insertion explicitly.
|
// disable the ancient style insertion explicitly.
|
||||||
if origin >= frozen && frozen != 0 {
|
if origin >= frozen && origin != 0 {
|
||||||
d.ancientLimit = 0
|
d.ancientLimit = 0
|
||||||
log.Info("Disabling direct-ancient mode", "origin", origin, "ancient", frozen-1)
|
var ancient string
|
||||||
|
if frozen == 0 {
|
||||||
|
ancient = "null"
|
||||||
|
} else {
|
||||||
|
ancient = fmt.Sprintf("%d", frozen-1)
|
||||||
|
}
|
||||||
|
log.Info("Disabling direct-ancient mode", "origin", origin, "ancient", ancient)
|
||||||
} else if d.ancientLimit > 0 {
|
} else if d.ancientLimit > 0 {
|
||||||
log.Debug("Enabling direct-ancient mode", "ancient", d.ancientLimit)
|
log.Debug("Enabling direct-ancient mode", "ancient", d.ancientLimit)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
go.mod
3
go.mod
|
|
@ -24,7 +24,7 @@ require (
|
||||||
github.com/ethereum/c-kzg-4844/v2 v2.1.0
|
github.com/ethereum/c-kzg-4844/v2 v2.1.0
|
||||||
github.com/ethereum/go-verkle v0.2.2
|
github.com/ethereum/go-verkle v0.2.2
|
||||||
github.com/fatih/color v1.16.0
|
github.com/fatih/color v1.16.0
|
||||||
github.com/ferranbt/fastssz v0.1.2
|
github.com/ferranbt/fastssz v0.1.4
|
||||||
github.com/fjl/gencodec v0.1.0
|
github.com/fjl/gencodec v0.1.0
|
||||||
github.com/fsnotify/fsnotify v1.6.0
|
github.com/fsnotify/fsnotify v1.6.0
|
||||||
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff
|
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff
|
||||||
|
|
@ -101,6 +101,7 @@ require (
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
|
||||||
github.com/deepmap/oapi-codegen v1.6.0 // indirect
|
github.com/deepmap/oapi-codegen v1.6.0 // indirect
|
||||||
github.com/dlclark/regexp2 v1.7.0 // indirect
|
github.com/dlclark/regexp2 v1.7.0 // indirect
|
||||||
|
github.com/emicklei/dot v1.6.2 // indirect
|
||||||
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect
|
github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect
|
||||||
github.com/getsentry/sentry-go v0.27.0 // indirect
|
github.com/getsentry/sentry-go v0.27.0 // indirect
|
||||||
github.com/go-ole/go-ole v1.3.0 // indirect
|
github.com/go-ole/go-ole v1.3.0 // indirect
|
||||||
|
|
|
||||||
10
go.sum
10
go.sum
|
|
@ -108,14 +108,16 @@ github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 h1:+3HCtB74++ClLy8GgjU
|
||||||
github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
|
github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4=
|
||||||
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
|
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
|
||||||
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
|
github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM=
|
||||||
|
github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A=
|
||||||
|
github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s=
|
||||||
github.com/ethereum/c-kzg-4844/v2 v2.1.0 h1:gQropX9YFBhl3g4HYhwE70zq3IHFRgbbNPw0Shwzf5w=
|
github.com/ethereum/c-kzg-4844/v2 v2.1.0 h1:gQropX9YFBhl3g4HYhwE70zq3IHFRgbbNPw0Shwzf5w=
|
||||||
github.com/ethereum/c-kzg-4844/v2 v2.1.0/go.mod h1:TC48kOKjJKPbN7C++qIgt0TJzZ70QznYR7Ob+WXl57E=
|
github.com/ethereum/c-kzg-4844/v2 v2.1.0/go.mod h1:TC48kOKjJKPbN7C++qIgt0TJzZ70QznYR7Ob+WXl57E=
|
||||||
github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8=
|
github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8=
|
||||||
github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk=
|
github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk=
|
||||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||||
github.com/ferranbt/fastssz v0.1.2 h1:Dky6dXlngF6Qjc+EfDipAkE83N5I5DE68bY6O0VLNPk=
|
github.com/ferranbt/fastssz v0.1.4 h1:OCDB+dYDEQDvAgtAGnTSidK1Pe2tW3nFV40XyMkTeDY=
|
||||||
github.com/ferranbt/fastssz v0.1.2/go.mod h1:X5UPrE2u1UJjxHA8X54u04SBwdAQjG2sFtWs39YxyWs=
|
github.com/ferranbt/fastssz v0.1.4/go.mod h1:Ea3+oeoRGGLGm5shYAeDgu6PGUlcvQhE2fILyD9+tGg=
|
||||||
github.com/fjl/gencodec v0.1.0 h1:B3K0xPfc52cw52BBgUbSPxYo+HlLfAgWMVKRWXUXBcs=
|
github.com/fjl/gencodec v0.1.0 h1:B3K0xPfc52cw52BBgUbSPxYo+HlLfAgWMVKRWXUXBcs=
|
||||||
github.com/fjl/gencodec v0.1.0/go.mod h1:Um1dFHPONZGTHog1qD1NaWjXJW/SPB38wPv0O8uZ2fI=
|
github.com/fjl/gencodec v0.1.0/go.mod h1:Um1dFHPONZGTHog1qD1NaWjXJW/SPB38wPv0O8uZ2fI=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
|
|
@ -316,8 +318,8 @@ github.com/protolambda/zrnt v0.34.1 h1:qW55rnhZJDnOb3TwFiFRJZi3yTXFrJdGOFQM7vCwY
|
||||||
github.com/protolambda/zrnt v0.34.1/go.mod h1:A0fezkp9Tt3GBLATSPIbuY4ywYESyAuc/FFmPKg8Lqs=
|
github.com/protolambda/zrnt v0.34.1/go.mod h1:A0fezkp9Tt3GBLATSPIbuY4ywYESyAuc/FFmPKg8Lqs=
|
||||||
github.com/protolambda/ztyp v0.2.2 h1:rVcL3vBu9W/aV646zF6caLS/dyn9BN8NYiuJzicLNyY=
|
github.com/protolambda/ztyp v0.2.2 h1:rVcL3vBu9W/aV646zF6caLS/dyn9BN8NYiuJzicLNyY=
|
||||||
github.com/protolambda/ztyp v0.2.2/go.mod h1:9bYgKGqg3wJqT9ac1gI2hnVb0STQq7p/1lapqrqY1dU=
|
github.com/protolambda/ztyp v0.2.2/go.mod h1:9bYgKGqg3wJqT9ac1gI2hnVb0STQq7p/1lapqrqY1dU=
|
||||||
github.com/prysmaticlabs/gohashtree v0.0.1-alpha.0.20220714111606-acbb2962fb48 h1:cSo6/vk8YpvkLbk9v3FO97cakNmUoxwi2KMP8hd5WIw=
|
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
|
||||||
github.com/prysmaticlabs/gohashtree v0.0.1-alpha.0.20220714111606-acbb2962fb48/go.mod h1:4pWaT30XoEx1j8KNJf3TV+E3mQkaufn7mf+jRNb/Fuk=
|
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
|
||||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue