Skip to content

Commit 6000f6e

Browse files
authored
Merge branch 'master' into paul/tobin-tax-removal
2 parents a3358e8 + fedfe26 commit 6000f6e

File tree

204 files changed

+3735
-13654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+3735
-13654
lines changed

.github/workflows/add-docker-tag.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ jobs:
4444
- name: 'Set up Cloud SDK'
4545
uses: 'google-github-actions/setup-gcloud@v1'
4646

47-
- id: add-tag
47+
- id: add-tag-devopsre
4848
run: |
4949
gcloud container images add-tag us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth:${{ inputs.origin-tag }} us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth:${{ inputs.destination-tag }}
5050
gcloud container images add-tag us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-all:${{ inputs.origin-tag }} us-west1-docker.pkg.dev/devopsre/celo-blockchain-public/geth-all:${{ inputs.destination-tag }}
51+
52+
- id: add-tag-celo-org
53+
run: |
54+
gcloud container images add-tag us-docker.pkg.dev/celo-org/us.gcr.io/geth:${{ inputs.origin-tag }} us-docker.pkg.dev/celo-org/us.gcr.io/geth:${{ inputs.destination-tag }}
55+
gcloud container images add-tag us-docker.pkg.dev/celo-org/us.gcr.io/geth-all:${{ inputs.origin-tag }} us-docker.pkg.dev/celo-org/us.gcr.io/geth-all:${{ inputs.destination-tag }}

.github/workflows/build-sign-release-images.yaml

+39-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
context: .
6767
file: Dockerfile.alltools
6868

69-
Build-Container-geth:
69+
Build-Container-geth-devopsre:
7070
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
7171
if: startsWith(github.ref, 'refs/tags/v')
7272
needs:
@@ -78,7 +78,7 @@ jobs:
7878
tag: ${{needs.Replace-Tag-V.outputs.replaced-tag}}
7979
context: .
8080

81-
Build-Container-geth-all:
81+
Build-Container-geth-all-devopsre:
8282
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
8383
if: startsWith(github.ref, 'refs/tags/v')
8484
needs:
@@ -91,13 +91,40 @@ jobs:
9191
context: .
9292
file: Dockerfile.alltools
9393

94+
Build-Container-geth-celo-org:
95+
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
96+
if: startsWith(github.ref, 'refs/tags/v')
97+
needs:
98+
- Replace-Tag-V
99+
with:
100+
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
101+
service-account: '[email protected]'
102+
artifact-registry: us-docker.pkg.dev/celo-org/us.gcr.io/geth
103+
tag: ${{needs.Replace-Tag-V.outputs.replaced-tag}}
104+
context: .
105+
106+
Build-Container-geth-all-celo-org:
107+
uses: celo-org/reusable-workflows/.github/workflows/[email protected]
108+
if: startsWith(github.ref, 'refs/tags/v')
109+
needs:
110+
- Replace-Tag-V
111+
with:
112+
workload-id-provider: 'projects/1094498259535/locations/global/workloadIdentityPools/gh-celo-blockchain/providers/github-by-repos'
113+
service-account: '[email protected]'
114+
artifact-registry: us-docker.pkg.dev/celo-org/us.gcr.io/geth-all
115+
tag: ${{needs.Replace-Tag-V.outputs.replaced-tag}}
116+
context: .
117+
file: Dockerfile.alltools
118+
94119
Add-Baklava-tag:
95120
if: startsWith(github.ref, 'refs/tags/v')
96121
uses: ./.github/workflows/add-docker-tag.yaml
97122
needs:
98123
- Replace-Tag-V
99-
- Build-Container
100-
- Build-Container-all
124+
- Build-Container-devopsre
125+
- Build-Container-all-devopsre
126+
- Build-Container-celo-org
127+
- Build-Container-all-celo-org
101128
with:
102129
origin-tag: ${{needs.Replace-Tag-V.outputs.replaced-tag}}
103130
destination-tag: baklava
@@ -107,8 +134,10 @@ jobs:
107134
uses: ./.github/workflows/add-docker-tag.yaml
108135
needs:
109136
- Replace-Tag-V
110-
- Build-Container
111-
- Build-Container-all
137+
- Build-Container-devopsre
138+
- Build-Container-all-devopsre
139+
- Build-Container-celo-org
140+
- Build-Container-all-celo-org
112141
with:
113142
origin-tag: ${{needs.Replace-Tag-V.outputs.replaced-tag}}
114143
destination-tag: ${{needs.Replace-Tag-V.outputs.major}}
@@ -118,8 +147,10 @@ jobs:
118147
uses: ./.github/workflows/add-docker-tag.yaml
119148
needs:
120149
- Replace-Tag-V
121-
- Build-Container
122-
- Build-Container-all
150+
- Build-Container-devopsre
151+
- Build-Container-all-devopsre
152+
- Build-Container-celo-org
153+
- Build-Container-all-celo-org
123154
with:
124155
origin-tag: ${{needs.Replace-Tag-V.outputs.replaced-tag}}
125156
destination-tag: ${{needs.Replace-Tag-V.outputs.major-minor}}

.github/workflows/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ jobs:
182182
- name: Upload coverage to codecov
183183
if: always()
184184
uses: codecov/codecov-action@v3
185+
- name: Fail if there are failed tests
186+
if: steps.unit-tests-summary.outputs.failed > 0
187+
run: |
188+
echo "There are failed tests"
189+
exit 1
185190
186191
race:
187192
name: Data race detector

accounts/abi/bind/backends/simulated.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ type SimulatedBackend struct {
7676
// and uses a simulated blockchain for testing purposes.
7777
// A simulated backend always uses chainID 1337.
7878
func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.GenesisAlloc) *SimulatedBackend {
79-
genesis := core.Genesis{Config: params.IstanbulTestChainConfig, Alloc: alloc}
79+
genesis := core.Genesis{Config: params.TestChainConfig, Alloc: alloc}
8080
genesis.MustCommit(database)
8181
blockchain, _ := core.NewBlockChain(database, nil, genesis.Config, mockEngine.NewFaker(), vm.Config{}, nil, nil)
8282

@@ -564,7 +564,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
564564
return nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified")
565565
}
566566
head := b.blockchain.CurrentHeader()
567-
if !b.blockchain.Config().IsEspresso(head.Number) {
567+
if !b.blockchain.Config().IsLondon(head.Number) {
568568
// If there's no basefee, then it must be a non-1559 execution
569569
if call.GasPrice == nil {
570570
call.GasPrice = new(big.Int)
@@ -617,6 +617,9 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
617617
var sysCtx *core.SysContractCallCtx
618618
if b.config.IsEspresso(block.Number()) {
619619
parent := b.blockchain.GetBlockByNumber(block.NumberU64() - 1)
620+
if block.NumberU64() == 0 {
621+
parent = b.blockchain.GetBlockByNumber(0)
622+
}
620623
sysStateDB, err := b.blockchain.StateAt(parent.Root())
621624
if err != nil {
622625
return nil, err

accounts/abi/bind/backends/simulated_test.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestSimulatedBackend(t *testing.T) {
6464

6565
code := `6060604052600a8060106000396000f360606040526008565b00`
6666
var gas uint64 = 3000000
67-
tx := types.NewContractCreation(0, big.NewInt(0), gas, gasPrice, nil, nil, nil, common.FromHex(code))
67+
tx := types.NewContractCreation(0, big.NewInt(0), gas, gasPrice, common.FromHex(code))
6868
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, key)
6969

7070
err = sim.SendTransaction(context.Background(), tx)
@@ -125,12 +125,12 @@ func TestNewSimulatedBackend(t *testing.T) {
125125
sim := simTestBackend(testAddr)
126126
defer sim.Close()
127127

128-
if sim.config != params.IstanbulTestChainConfig {
129-
t.Errorf("expected sim config to equal params.IstanbulTestChainConfig, got %v", sim.config)
128+
if sim.config != params.TestChainConfig {
129+
t.Errorf("expected sim config to equal params.TestChainConfig, got %v", sim.config)
130130
}
131131

132-
if sim.blockchain.Config() != params.IstanbulTestChainConfig {
133-
t.Errorf("expected sim blockchain config to equal params.IstanbulTestChainConfig, got %v", sim.config)
132+
if sim.blockchain.Config() != params.TestChainConfig {
133+
t.Errorf("expected sim blockchain config to equal params.TestChainConfig, got %v", sim.config)
134134
}
135135

136136
stateDB, _ := sim.blockchain.State()
@@ -162,7 +162,7 @@ func TestNewAdjustTimeFail(t *testing.T) {
162162
// Create tx and send
163163
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
164164

165-
tx := types.NewTransaction(0, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
165+
tx := types.NewTransaction(0, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
166166
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
167167
if err != nil {
168168
t.Errorf("could not sign tx: %v", err)
@@ -183,7 +183,7 @@ func TestNewAdjustTimeFail(t *testing.T) {
183183
t.Errorf("adjusted time not equal to a minute. prev: %v, new: %v", prevTime, newTime)
184184
}
185185
// Put a transaction after adjusting time
186-
tx2 := types.NewTransaction(1, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
186+
tx2 := types.NewTransaction(1, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
187187
signedTx2, err := types.SignTx(tx2, types.HomesteadSigner{}, testKey)
188188
if err != nil {
189189
t.Errorf("could not sign tx: %v", err)
@@ -285,7 +285,7 @@ func TestNonceAt(t *testing.T) {
285285
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
286286
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
287287

288-
tx := types.NewTransaction(nonce, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
288+
tx := types.NewTransaction(nonce, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
289289
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
290290
if err != nil {
291291
t.Errorf("could not sign tx: %v", err)
@@ -329,7 +329,7 @@ func TestSendTransaction(t *testing.T) {
329329
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
330330
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
331331

332-
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
332+
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
333333
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
334334
if err != nil {
335335
t.Errorf("could not sign tx: %v", err)
@@ -367,7 +367,7 @@ func TestTransactionByHash(t *testing.T) {
367367
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
368368
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
369369

370-
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
370+
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
371371
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
372372
if err != nil {
373373
t.Errorf("could not sign tx: %v", err)
@@ -615,7 +615,7 @@ func TestTransactionCount(t *testing.T) {
615615
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
616616
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
617617

618-
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
618+
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
619619
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
620620
if err != nil {
621621
t.Errorf("could not sign tx: %v", err)
@@ -672,7 +672,7 @@ func TestTransactionInBlock(t *testing.T) {
672672
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
673673
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
674674

675-
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
675+
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
676676
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
677677
if err != nil {
678678
t.Errorf("could not sign tx: %v", err)
@@ -730,7 +730,7 @@ func TestPendingNonceAt(t *testing.T) {
730730
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
731731
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
732732

733-
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
733+
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
734734
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
735735
if err != nil {
736736
t.Errorf("could not sign tx: %v", err)
@@ -753,7 +753,7 @@ func TestPendingNonceAt(t *testing.T) {
753753
}
754754

755755
// make a new transaction with a nonce of 1
756-
tx = types.NewTransaction(uint64(1), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
756+
tx = types.NewTransaction(uint64(1), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
757757
signedTx, err = types.SignTx(tx, types.HomesteadSigner{}, testKey)
758758
if err != nil {
759759
t.Errorf("could not sign tx: %v", err)
@@ -785,7 +785,7 @@ func TestTransactionReceipt(t *testing.T) {
785785
//// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
786786
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
787787

788-
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
788+
tx := types.NewTransaction(uint64(0), testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
789789
signedTx, err := types.SignTx(tx, types.HomesteadSigner{}, testKey)
790790
if err != nil {
791791
t.Errorf("could not sign tx: %v", err)
@@ -1211,7 +1211,7 @@ func TestForkResendTx(t *testing.T) {
12111211
// head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
12121212
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
12131213

1214-
_tx := types.NewTransaction(0, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil, nil, nil, nil)
1214+
_tx := types.NewTransaction(0, testAddr, big.NewInt(1000), params.TxGas, gasPrice, nil)
12151215
tx, _ := types.SignTx(_tx, types.HomesteadSigner{}, testKey)
12161216
sim.SendTransaction(context.Background(), tx)
12171217
sim.Commit()

accounts/abi/bind/util_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333

3434
var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
3535

36-
var genericBaseFee = big.NewInt(2) // set a constant gas price to be above the GPM.
36+
var genericBaseFee = big.NewInt(3) // set a constant gas price to be above the GPM.
3737

3838
var waitDeployedTests = map[string]struct {
3939
code string
@@ -64,7 +64,7 @@ func TestWaitDeployed(t *testing.T) {
6464
// head, _ := backend.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
6565
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
6666

67-
tx := types.NewContractCreation(0, big.NewInt(0), test.gas, gasPrice, nil, nil, nil, common.FromHex(test.code))
67+
tx := types.NewContractCreation(0, big.NewInt(0), test.gas, gasPrice, common.FromHex(test.code))
6868
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, testKey)
6969

7070
// Wait for it to get mined in the background.
@@ -108,7 +108,7 @@ func TestWaitDeployedCornerCases(t *testing.T) {
108108
// Create a transaction to an account.
109109
code := "6060604052600a8060106000396000f360606040526008565b00"
110110
tx := types.NewTransaction(0, common.HexToAddress("0x01"), big.NewInt(0), 3000000,
111-
gasPrice, nil, nil, nil, common.FromHex(code))
111+
gasPrice, common.FromHex(code))
112112
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, testKey)
113113
ctx, cancel := context.WithCancel(context.Background())
114114
defer cancel()
@@ -120,7 +120,7 @@ func TestWaitDeployedCornerCases(t *testing.T) {
120120
}
121121

122122
// Create a transaction that is not mined.
123-
tx = types.NewContractCreation(1, big.NewInt(0), 3000000, gasPrice, nil, nil, nil, common.FromHex(code))
123+
tx = types.NewContractCreation(1, big.NewInt(0), 3000000, gasPrice, common.FromHex(code))
124124
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, testKey)
125125

126126
go func() {

accounts/abi/bind_v2/util_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestWaitDeployed(t *testing.T) {
6464
// head, _ := backend.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
6565
gasPrice := new(big.Int).Add(genericBaseFee, big.NewInt(1))
6666

67-
tx := types.NewContractCreation(0, big.NewInt(0), test.gas, gasPrice, nil, nil, nil, common.FromHex(test.code))
67+
tx := types.NewContractCreation(0, big.NewInt(0), test.gas, gasPrice, common.FromHex(test.code))
6868
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, testKey)
6969

7070
// Wait for it to get mined in the background.
@@ -108,7 +108,7 @@ func TestWaitDeployedCornerCases(t *testing.T) {
108108
// Create a transaction to an account.
109109
code := "6060604052600a8060106000396000f360606040526008565b00"
110110
tx := types.NewTransaction(0, common.HexToAddress("0x01"), big.NewInt(0), 3000000,
111-
gasPrice, nil, nil, nil, common.FromHex(code))
111+
gasPrice, common.FromHex(code))
112112
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, testKey)
113113
ctx, cancel := context.WithCancel(context.Background())
114114
defer cancel()
@@ -120,7 +120,7 @@ func TestWaitDeployedCornerCases(t *testing.T) {
120120
}
121121

122122
// Create a transaction that is not mined.
123-
tx = types.NewContractCreation(1, big.NewInt(0), 3000000, gasPrice, nil, nil, nil, common.FromHex(code))
123+
tx = types.NewContractCreation(1, big.NewInt(0), 3000000, gasPrice, common.FromHex(code))
124124
tx, _ = types.SignTx(tx, types.HomesteadSigner{}, testKey)
125125

126126
go func() {

build/ci.go

-6
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ var (
8080
executablePath("evm"),
8181
executablePath("geth"),
8282
executablePath("rlpdump"),
83-
executablePath("clef"),
8483
executablePath("blspopchecker"),
8584
}
8685

@@ -106,10 +105,6 @@ var (
106105
BinaryName: "rlpdump",
107106
Description: "Developer utility tool that prints RLP structures.",
108107
},
109-
{
110-
BinaryName: "clef",
111-
Description: "Ethereum account management tool.",
112-
},
113108
{
114109
BinaryName: "blspopchecker",
115110
Description: "Developer utility tool checks BLS PoP signatures in genesis.",
@@ -1342,7 +1337,6 @@ func xgoAllToolsArchiveFiles(target string, dir string) []string {
13421337
executableXgoPath("evm", target, dir),
13431338
executableXgoPath("geth", target, dir),
13441339
executableXgoPath("rlpdump", target, dir),
1345-
executableXgoPath("clef", target, dir),
13461340
executableXgoPath("blspopchecker", target, dir),
13471341
}
13481342
}

0 commit comments

Comments
 (0)