Skip to content

Commit 9d40d68

Browse files
Merge branch 'node-real:main' into devel
2 parents c02be22 + 7be4557 commit 9d40d68

File tree

20 files changed

+201
-32
lines changed

20 files changed

+201
-32
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Check
33
on:
44
push:
55
branches:
6-
- devel
6+
- main
77
- devel_1.2.0
88
workflow_dispatch:
99

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ name: CI
22
on:
33
push:
44
branches:
5-
- devel
6-
- alpha
5+
- main
76
- devel_1.2.0
87
- 'release/**'
98
pull_request:
109
branches:
1110
- devel_1.2.0
12-
- devel
13-
- alpha
11+
- main
1412
- 'release/**'
1513
types:
1614
- opened
@@ -113,7 +111,7 @@ jobs:
113111

114112
docker-build-check:
115113
# don't run this on devel - the PR must have run it to be merged and it misleads that this pushes the docker image
116-
if: (${{ github.event_name == 'push' || !github.event.pull_request.draft }}) && ${{ github.ref != 'refs/heads/devel' }}
114+
if: (${{ github.event_name == 'push' || !github.event.pull_request.draft }}) && ${{ github.ref != 'refs/heads/main' }}
117115
runs-on: ubuntu-22.04
118116

119117
steps:

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Coverage
22
on:
33
push:
44
branches:
5-
- devel
5+
- main
66
- devel_1.2.0
77

88
jobs:

.github/workflows/qa-clean-exit-block-downloading.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release/**'
77
pull_request:
88
branches:
9-
- devel
9+
- main
1010
- 'release/**'
1111
types:
1212
- ready_for_review

.github/workflows/qa-clean-exit-snapshot-downloading.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: QA - Clean exit (snapshot downloading)
33
on:
44
push:
55
branches:
6-
- devel
6+
- main
77
- 'release/**'
88
pull_request:
99
branches:
10-
- devel
10+
- main
1111
- 'release/**'
1212
types:
1313
- ready_for_review

.github/workflows/test-integration.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Integration tests
22
on:
33
push:
44
branches:
5-
- devel
6-
- alpha
5+
- main
76
- 'release/**'
87
schedule:
98
- cron: '20 16 * * *' # daily at 16:20 UTC

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ DOCKER_TAG ?= thorax/erigon:latest
1717
# Pipe error below to /dev/null since Makefile structure kind of expects
1818
# Go to be available, but with docker it's not strictly necessary
1919
CGO_CFLAGS := $(shell $(GO) env CGO_CFLAGS 2>/dev/null) # don't lose default
20-
CGO_CFLAGS += -DMDBX_FORCE_ASSERTIONS=0 # Enable MDBX's asserts by default in 'devel' branch and disable in releases
20+
CGO_CFLAGS += -DMDBX_FORCE_ASSERTIONS=0 # Enable MDBX's asserts by default in 'main' branch and disable in releases
2121
#CGO_CFLAGS += -DMDBX_DISABLE_VALIDATION=1 # This feature is not ready yet
2222
#CGO_CFLAGS += -DMDBX_ENABLE_PROFGC=0 # Disabled by default, but may be useful for performance debugging
2323
#CGO_CFLAGS += -DMDBX_ENABLE_PGOP_STAT=0 # Disabled by default, but may be useful for performance debugging

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Bear in mind that SSD performance deteriorates when close to capacity.
7070

7171
RAM: >=16GB, 64-bit architecture.
7272

73-
[Golang version >= 1.20](https://golang.org/doc/install); GCC 10+ or Clang; On Linux: kernel > v4
73+
[Golang version >= 1.21](https://golang.org/doc/install); GCC 10+ or Clang; On Linux: kernel > v4
7474

7575
<code>🔬 more details on disk storage [here](https://erigon.substack.com/p/disk-footprint-changes-in-new-erigon?s=r)
7676
and [here](https://ledgerwatch.github.io/turbo_geth_release.html#Disk-space).</code>
@@ -80,6 +80,7 @@ Usage
8080

8181
### Getting Started
8282

83+
Building erigon requires both a Go (version 1.21 or later) and a C compiler (GCC 10+ or Clang).
8384
For building the latest release (this will be suitable for most users just wanting to run a node):
8485

8586
```sh

core/data_availability.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func IsDataAvailable(chain consensus.ChainHeaderReader, header *types.Header, bo
5353
}
5454

5555
if len(blobTxs) != len(sidecars) {
56-
return fmt.Errorf("blob info mismatch: sidecars %d, versionedHashes:%d", len(sidecars), len(blobTxs))
56+
return fmt.Errorf("number %d, hash %v, blob info mismatch: have %d, want:%d", header.Number.Uint64(), header.Hash(), len(sidecars), len(blobTxs))
5757
}
5858

5959
// check blob amount

core/types/blob_sidecars.go

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"math/big"
99

1010
libcommon "github.com/ledgerwatch/erigon-lib/common"
11+
rlp2 "github.com/ledgerwatch/erigon-lib/rlp"
1112
"github.com/ledgerwatch/erigon/rlp"
1213
)
1314

@@ -65,18 +66,31 @@ func (s *BlobSidecar) EncodeRLP(w io.Writer) error {
6566
if err := s.BlobTxSidecar.EncodeRLP(w); err != nil {
6667
return err
6768
}
68-
if err := rlp.Encode(w, s.BlockNumber); err != nil {
69+
70+
if err := rlp.EncodeBigInt(s.BlockNumber, w, b[:]); err != nil {
71+
return err
72+
}
73+
74+
b[0] = 128 + 32
75+
if _, err := w.Write(b[:1]); err != nil {
76+
return err
77+
}
78+
if _, err := w.Write(s.BlockHash.Bytes()); err != nil {
6979
return err
7080
}
71-
if err := rlp.Encode(w, s.BlockHash); err != nil {
81+
82+
if err := rlp.EncodeInt(s.TxIndex, w, b[:]); err != nil {
7283
return err
7384
}
74-
if err := rlp.Encode(w, s.TxIndex); err != nil {
85+
86+
b[0] = 128 + 32
87+
if _, err := w.Write(b[:1]); err != nil {
7588
return err
7689
}
77-
if err := rlp.Encode(w, s.TxHash); err != nil {
90+
if _, err := w.Write(s.TxHash.Bytes()); err != nil {
7891
return err
7992
}
93+
8094
return nil
8195
}
8296

@@ -89,14 +103,20 @@ func (sc *BlobSidecar) DecodeRLP(s *rlp.Stream) error {
89103
if err := sc.BlobTxSidecar.DecodeRLP(s); err != nil {
90104
return err
91105
}
106+
92107
var b []byte
93-
if b, err = s.Bytes(); err != nil {
108+
109+
if b, err = s.Uint256Bytes(); err != nil {
94110
return err
95111
}
96112
sc.BlockNumber = new(big.Int).SetBytes(b)
113+
97114
if b, err = s.Bytes(); err != nil {
98115
return err
99116
}
117+
if len(b) != 32 {
118+
return fmt.Errorf("invalid block hash length: %d", len(b))
119+
}
100120
sc.BlockHash = libcommon.BytesToHash(b)
101121

102122
if sc.TxIndex, err = s.Uint(); err != nil {
@@ -106,6 +126,9 @@ func (sc *BlobSidecar) DecodeRLP(s *rlp.Stream) error {
106126
if b, err = s.Bytes(); err != nil {
107127
return err
108128
}
129+
if len(b) != 32 {
130+
return fmt.Errorf("invalid tx hash length: %d", len(b))
131+
}
109132
sc.TxHash = libcommon.BytesToHash(b)
110133

111134
if err = s.ListEnd(); err != nil {
@@ -116,10 +139,17 @@ func (sc *BlobSidecar) DecodeRLP(s *rlp.Stream) error {
116139

117140
func (s *BlobSidecar) payloadSize() int {
118141
size := s.BlobTxSidecar.payloadSize()
142+
size += rlp2.ListPrefixLen(size) // size of payload size encoding
143+
144+
size++
119145
size += rlp.BigIntLenExcludingHead(s.BlockNumber)
120-
size += 32
121-
size += 8
122-
size += 32
146+
147+
size += rlp2.StringLen(s.BlockHash.Bytes())
148+
149+
size++
150+
size += rlp.IntLenExcludingHead(s.TxIndex)
151+
152+
size += rlp2.StringLen(s.TxHash.Bytes())
123153
return size
124154
}
125155

0 commit comments

Comments
 (0)