Skip to content

Commit 302c315

Browse files
FletcherMannoel2004Thegaram0xmountaintopNazariiDenha
authored
Merge commits under tag of scroll-v3.3.0 from scroll-tech (#10)
* feat(trace): add storage proof about l1fee (baseFee, overhead, scalar) and withdraw root into trace (#314) * add proof for predeployed storages * reverse inneeded code * update for mainbranch merging * add coinbase storage as trace * comment for clarify * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * feat: enable eip and update check (#335) * enable eip and update check * Update version.go --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * fix(trace): deletion proof missed path terminated by empty node (#330) * fix deletion proof issue on empty node * refine for better implement and fix unittest * Update version.go --------- Co-authored-by: HAOYUatHZ <[email protected]> * fix(API): use `hexutil.Big` for `l1Fee` in `GetTransactionReceipt` (#336) * It's not a bug, but if just translate to hexutil.Big can be better. * Revert editor's auto change. * Update version. * Update version. * refactor(config): moved fee vault addr to rollup config (#341) * moved fee vault addr to rollup config * fixed linter issue * added back FeeVaultAddress --------- Co-authored-by: Péter Garamvölgyi <[email protected]> * feat(abigen): add `--contract` flag to specify a given contract (#334) * add contract flag * Use GlobalXX * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> * Update cmd/abigen/main.go Co-authored-by: Péter Garamvölgyi <[email protected]> --------- Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> * build(github): update github action yaml (#347) * build(github): update github action yaml * fix * ci(github): update pull request template (#349) * chore(github): update pull request template * Update pull_request_template.md * Return error for disabled precompile calls (#337) return error for disabled precompile calls --------- Co-authored-by: Ho <[email protected]> Co-authored-by: Péter Garamvölgyi <[email protected]> Co-authored-by: HAOYUatHZ <[email protected]> Co-authored-by: Nazarii Denha <[email protected]> Co-authored-by: maskpp <[email protected]> Co-authored-by: Richord <[email protected]>
1 parent 374b784 commit 302c315

File tree

8 files changed

+92
-10
lines changed

8 files changed

+92
-10
lines changed

.github/pull_request_template.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,32 @@
33
...
44

55

6-
## 2. Deployment tag versioning
6+
## 2. PR title
7+
8+
Your PR title must follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) (as we are doing squash merge for each PR), so it must start with one of the following [types](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type):
9+
10+
- [ ] build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
11+
- [ ] ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
12+
- [ ] docs: Documentation-only changes
13+
- [ ] feat: A new feature
14+
- [ ] fix: A bug fix
15+
- [ ] perf: A code change that improves performance
16+
- [ ] refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
17+
- [ ] style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
18+
- [ ] test: Adding missing tests or correcting existing tests
19+
20+
21+
## 3. Deployment tag versioning
722

823
Has the version in `params/version.go` been updated?
924

1025
- [ ] This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
1126
- [ ] Yes
1227

28+
29+
## 4. Breaking change label
30+
31+
Does this PR have the `breaking-change` label?
32+
33+
- [ ] This PR is not a breaking change
34+
- [ ] Yes

.github/workflows/docker.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Docker
33
on:
44
push:
55
tags:
6-
- scroll-v**
6+
- '*'
77

88
jobs:
99
build-and-push:

.github/workflows/l2geth_ci.yml

+9
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
- develop
77
- alpha
88
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
- ready_for_review
914
name: CI
1015
jobs:
1116
build:
17+
if: github.event.pull_request.draft == false
1218
runs-on: ubuntu-latest
1319
steps:
1420
- name: Install Go
@@ -21,6 +27,7 @@ jobs:
2127
run: |
2228
make geth
2329
check:
30+
if: github.event.pull_request.draft == false
2431
runs-on: ubuntu-latest
2532
steps:
2633
- name: Install Go
@@ -34,6 +41,7 @@ jobs:
3441
rm -rf $HOME/.cache/golangci-lint
3542
make lint
3643
goimports-lint:
44+
if: github.event.pull_request.draft == false
3745
runs-on: ubuntu-latest
3846
steps:
3947
- name: Install Go
@@ -53,6 +61,7 @@ jobs:
5361
exit 1
5462
fi
5563
test:
64+
if: github.event.pull_request.draft == false
5665
runs-on: ubuntu-latest
5766
steps:
5867
- name: Install Go

cmd/abigen/main.go

+14-3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ var (
9999
Name: "alias",
100100
Usage: "Comma separated aliases for function and event renaming, e.g. original1=alias1, original2=alias2",
101101
}
102+
contractFlag = cli.StringFlag{
103+
Name: "contract",
104+
Usage: "Name of the contract to generate the bindings for",
105+
}
102106
)
103107

104108
func init() {
@@ -117,6 +121,7 @@ func init() {
117121
outFlag,
118122
langFlag,
119123
aliasFlag,
124+
contractFlag,
120125
}
121126
app.Action = utils.MigrateFlags(abigen)
122127
cli.CommandHelpTemplate = flags.OriginCommandHelpTemplate
@@ -225,6 +230,13 @@ func abigen(c *cli.Context) error {
225230
}
226231
// Gather all non-excluded contract for binding
227232
for name, contract := range contracts {
233+
// The fully qualified name is of the form <solFilePath>:<type>
234+
nameParts := strings.Split(name, ":")
235+
typeName := nameParts[len(nameParts)-1]
236+
// If a contract name is provided then ignore all other contracts
237+
if c.GlobalIsSet(contractFlag.Name) && c.GlobalString(contractFlag.Name) != typeName {
238+
continue
239+
}
228240
if exclude[strings.ToLower(name)] {
229241
continue
230242
}
@@ -235,11 +247,10 @@ func abigen(c *cli.Context) error {
235247
abis = append(abis, string(abi))
236248
bins = append(bins, contract.Code)
237249
sigs = append(sigs, contract.Hashes)
238-
nameParts := strings.Split(name, ":")
239-
types = append(types, nameParts[len(nameParts)-1])
250+
types = append(types, typeName)
240251

241252
libPattern := crypto.Keccak256Hash([]byte(name)).String()[2:36]
242-
libs[libPattern] = nameParts[len(nameParts)-1]
253+
libs[libPattern] = typeName
243254
}
244255
}
245256
// Extract all aliases from the flags

core/vm/contracts.go

+34
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ import (
3434
"golang.org/x/crypto/ripemd160"
3535
)
3636

37+
var (
38+
errPrecompileDisabled = errors.New("sha256, ripemd160, blake2f precompiles temporarily disabled")
39+
)
40+
3741
// PrecompiledContract is the basic interface for native Go contracts. The implementation
3842
// requires a deterministic gas count based on the input size of the Run method of the
3943
// contract.
@@ -96,11 +100,14 @@ var PrecompiledContractsBerlin = map[common.Address]PrecompiledContract{
96100
// contracts used in the Archimedes release. Same as Berlin but without sha2, blake2f, ripemd160
97101
var PrecompiledContractsArchimedes = map[common.Address]PrecompiledContract{
98102
common.BytesToAddress([]byte{1}): &ecrecover{},
103+
common.BytesToAddress([]byte{2}): &sha256hashDisabled{},
104+
common.BytesToAddress([]byte{3}): &ripemd160hashDisabled{},
99105
common.BytesToAddress([]byte{4}): &dataCopy{},
100106
common.BytesToAddress([]byte{5}): &bigModExp{eip2565: true},
101107
common.BytesToAddress([]byte{6}): &bn256AddIstanbul{},
102108
common.BytesToAddress([]byte{7}): &bn256ScalarMulIstanbul{},
103109
common.BytesToAddress([]byte{8}): &bn256PairingIstanbul{},
110+
common.BytesToAddress([]byte{9}): &blake2FDisabled{},
104111
}
105112

106113
// PrecompiledContractsBLS contains the set of pre-compiled Ethereum
@@ -227,6 +234,15 @@ func (c *sha256hash) Run(input []byte) ([]byte, error) {
227234
return h[:], nil
228235
}
229236

237+
type sha256hashDisabled struct{}
238+
239+
func (c *sha256hashDisabled) RequiredGas(input []byte) uint64 {
240+
return (&sha256hash{}).RequiredGas(input)
241+
}
242+
func (c *sha256hashDisabled) Run(input []byte) ([]byte, error) {
243+
return nil, errPrecompileDisabled
244+
}
245+
230246
// RIPEMD160 implemented as a native contract.
231247
type ripemd160hash struct{}
232248

@@ -243,6 +259,15 @@ func (c *ripemd160hash) Run(input []byte) ([]byte, error) {
243259
return common.LeftPadBytes(ripemd.Sum(nil), 32), nil
244260
}
245261

262+
type ripemd160hashDisabled struct{}
263+
264+
func (c *ripemd160hashDisabled) RequiredGas(input []byte) uint64 {
265+
return (&ripemd160hash{}).RequiredGas(input)
266+
}
267+
func (c *ripemd160hashDisabled) Run(input []byte) ([]byte, error) {
268+
return nil, errPrecompileDisabled
269+
}
270+
246271
// data copy implemented as a native contract.
247272
type dataCopy struct{}
248273

@@ -636,6 +661,15 @@ func (c *blake2F) Run(input []byte) ([]byte, error) {
636661
return output, nil
637662
}
638663

664+
type blake2FDisabled struct{}
665+
666+
func (c *blake2FDisabled) RequiredGas(input []byte) uint64 {
667+
return (&blake2F{}).RequiredGas(input)
668+
}
669+
func (c *blake2FDisabled) Run(input []byte) ([]byte, error) {
670+
return nil, errPrecompileDisabled
671+
}
672+
639673
var (
640674
errBLS12381InvalidInputLength = errors.New("invalid input length")
641675
errBLS12381InvalidFieldElementTopBytes = errors.New("invalid field element top bytes")

params/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"golang.org/x/crypto/sha3"
2525

2626
"github.com/scroll-tech/go-ethereum/common"
27+
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
2728
)
2829

2930
// Genesis hashes to enforce below configs on.
@@ -255,7 +256,6 @@ var (
255256
}
256257

257258
// ScrollAlphaChainConfig contains the chain parameters to run a node on the Scroll Alpha test network.
258-
ScrollFeeVaultAddress = common.HexToAddress("0x5300000000000000000000000000000000000005")
259259
ScrollMaxTxPerBlock = 44
260260
ScrollMaxTxPayloadBytesPerBlock = 120 * 1024
261261

@@ -285,7 +285,7 @@ var (
285285
UseZktrie: true,
286286
MaxTxPerBlock: &ScrollMaxTxPerBlock,
287287
MaxTxPayloadBytesPerBlock: &ScrollMaxTxPayloadBytesPerBlock,
288-
FeeVaultAddress: &ScrollFeeVaultAddress,
288+
FeeVaultAddress: &rcfg.ScrollFeeVaultAddress,
289289
EnableEIP2718: false,
290290
EnableEIP1559: false,
291291
},

params/version.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323

2424
const (
2525
VersionMajor = 3 // Major version component of the current release
26-
VersionMinor = 2 // Minor version component of the current release
27-
VersionPatch = 4 // Patch version component of the current release
26+
VersionMinor = 3 // Minor version component of the current release
27+
VersionPatch = 0 // Patch version component of the current release
2828
VersionMeta = "alpha" // Version metadata to append to the version string
2929
)
3030

@@ -44,7 +44,8 @@ var VersionWithMeta = func() string {
4444

4545
// ArchiveVersion holds the textual version string used for Geth archives.
4646
// e.g. "1.8.11-dea1ce05" for stable releases, or
47-
// "1.8.13-unstable-21c059b6" for unstable releases
47+
//
48+
// "1.8.13-unstable-21c059b6" for unstable releases
4849
func ArchiveVersion(gitCommit string) string {
4950
vsn := Version
5051
if VersionMeta != "stable" {

rollup/rcfg/config.go

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ var (
1616
L2MessageQueueAddress = common.HexToAddress("0x5300000000000000000000000000000000000000")
1717
WithdrawTrieRootSlot = common.BigToHash(big.NewInt(0))
1818

19+
// ScrollFeeVaultAddress is the address of the L2TxFeeVault
20+
// predeploy
21+
// see scroll-tech/scroll/contracts/src/L2/predeploys/L2TxFeeVault.sol
22+
ScrollFeeVaultAddress = common.HexToAddress("0x5300000000000000000000000000000000000005")
23+
1924
// L1GasPriceOracleAddress is the address of the L1GasPriceOracle
2025
// predeploy
2126
// see scroll-tech/scroll/contracts/src/L2/predeploys/L1GasPriceOracle.sol

0 commit comments

Comments
 (0)