Skip to content

Commit 5c58612

Browse files
authored
core/vm, go.mod: update uint256 and use faster method to write to memory (#30868)
Updates geth to use the latest uint256, and use faster memory-writer
1 parent bc1ec69 commit 5c58612

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

core/vm/memory.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ func (m *Memory) Set32(offset uint64, val *uint256.Int) {
7373
panic("invalid memory: store empty")
7474
}
7575
// Fill in relevant bits
76-
b32 := val.Bytes32()
77-
copy(m.store[offset:], b32[:])
76+
val.PutUint256(m.store[offset:])
7877
}
7978

8079
// Resize resizes the memory to size

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ require (
4040
github.com/hashicorp/go-bexpr v0.1.10
4141
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4
4242
github.com/holiman/bloomfilter/v2 v2.0.3
43-
github.com/holiman/uint256 v1.3.1
43+
github.com/holiman/uint256 v1.3.2
4444
github.com/huin/goupnp v1.3.0
4545
github.com/influxdata/influxdb-client-go/v2 v2.4.0
4646
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8
306306
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
307307
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
308308
github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
309-
github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs=
310-
github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
309+
github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA=
310+
github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
311311
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
312312
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
313313
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=

0 commit comments

Comments
 (0)