You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,44 @@
1
1
# Contributing
2
2
3
-
Thank you for considering to help out with the source code! We welcome
4
-
contributions from anyone on the internet, and are grateful for even the
5
-
smallest of fixes!
6
-
7
-
If you'd like to contribute to subnet-evm, please fork, fix, commit and send a
8
-
pull request for the maintainers to review and merge into the main code base. If
9
-
you wish to submit more complex changes though, please check up with the core
10
-
devs first on [Discord](https://chat.avalabs.org) to
11
-
ensure those changes are in line with the general philosophy of the project
12
-
and/or get some early feedback which can make both your efforts much lighter as
13
-
well as our review and merge procedures quick and simple.
3
+
Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!
4
+
5
+
If you'd like to contribute to subnet-evm, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on [Discord](https://chat.avalabs.org) to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.
14
6
15
7
## Coding guidelines
16
8
17
-
Please make sure your contributions adhere to our coding and documentation
18
-
guidelines:
9
+
Please make sure your contributions adhere to our coding guidelines:
- Pull requests need to be based on and opened against the `master` branch.
24
17
- Pull reuqests should include a detailed description
25
-
- Commits are required to be signed. See [here](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
18
+
- Commits are required to be signed. See the [commit signature verification documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
26
19
for information on signing commits.
27
20
- Commit messages should be prefixed with the package(s) they modify.
28
21
- E.g. "eth, rpc: make trace configs optional"
29
22
30
-
### Mocks
23
+
## Can I have feature X
24
+
25
+
Before you submit a feature request, please check and make sure that it isn't possible through some other means.
26
+
27
+
## Mocks
31
28
32
29
Mocks are auto-generated using [mockgen](https://pkg.go.dev/go.uber.org/mock/mockgen) and `//go:generate` commands in the code.
33
30
34
-
- To **re-generate all mocks**, use the command below from the root of the project:
31
+
- To **re-generate all mocks**, use the task below from the root of the project:
35
32
36
-
```sh
37
-
go generate -run mockgen ./...
38
-
```
33
+
```sh
34
+
task generate-mocks
35
+
```
39
36
40
-
* To **add** an interface that needs a corresponding mock generated:
41
-
*if the file `mocks_generate_test.go` exists in the package where the interface is located, either:
42
-
* modify its `//go:generate go tool -modfile=tools/go.mod mockgen` to generate a mock for your interface (preferred); or
43
-
* add another `//go:generate go tool -modfile=tools/go.mod mockgen` to generate a mock for your interface according to specific mock generation settings
44
-
*if the file `mocks_generate_test.go` does not exist in the package where the interface is located, create it with content (adapt as needed):
37
+
- To **add** an interface that needs a corresponding mock generated:
38
+
- if the file `mocks_generate_test.go` exists in the package where the interface is located, either:
39
+
- modify its `//go:generate go tool -modfile=tools/go.mod mockgen` to generate a mock for your interface (preferred); or
40
+
- add another `//go:generate go tool -modfile=tools/go.mod mockgen` to generate a mock for your interface according to specific mock generation settings
41
+
- if the file `mocks_generate_test.go` does not exist in the package where the interface is located, create it with content (adapt as needed):
45
42
46
43
```go
47
44
// Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved.
@@ -58,26 +55,29 @@ Mocks are auto-generated using [mockgen](https://pkg.go.dev/go.uber.org/mock/moc
58
55
- To **remove** an interface from having a corresponding mock generated:
59
56
1. Edit the `mocks_generate_test.go` file in the directory where the interface is defined
60
57
1. If the `//go:generate` mockgen command line:
61
-
* generates a mock file for multiple interfaces, remove your interface from the line
62
-
* generates a mock file only for the interface, remove the entire line. If the file is empty, remove `mocks_generate_test.go` as well.
58
+
- generates a mock file for multiple interfaces, remove your interface from the line
59
+
- generates a mock file only for the interface, remove the entire line. If the file is empty, remove `mocks_generate_test.go` as well.
63
60
64
61
## ToolDependencies
65
62
66
63
This project uses `go tool` to manage development tool dependencies in `tools/go.mod`. This isolates tool dependencies from the main application dependencies and provides consistent, version-locked tools across the team.
67
64
68
65
### ManagingTools
69
66
70
-
* To **add a new tool**:
67
+
- To **add a new tool**:
68
+
71
69
```sh
72
70
go get -tool -modfile=tools/go.mod example.com/tool/cmd/toolname@version
73
71
```
74
72
75
-
* To **upgrade a tool**:
73
+
- To **upgrade a tool**:
74
+
76
75
```sh
77
76
go get -tool -modfile=tools/go.mod example.com/tool/cmd/toolname@newversion
[Avalanche](https://docs.avax.network/avalanche-l1s) is a network composed of multiple blockchains.
8
+
[Avalanche](https://build.avax.network/docs/avalanche-l1s) is a network composed of multiple blockchains.
9
9
Each blockchain is an instance of a Virtual Machine (VM), much like an object in an object-oriented language is an instance of a class.
10
10
That is, the VM defines the behavior of the blockchain.
11
11
12
-
Subnet EVM is the [Virtual Machine (VM)](https://docs.avax.network/learn/virtual-machines) that defines the Subnet Contract Chains. Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/ava-labs/coreth).
12
+
Subnet EVM is the [Virtual Machine (VM)](https://build.avax.network/docs/quick-start/virtual-machines) that defines the Subnet Contract Chains. Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/ava-labs/coreth).
13
13
14
14
This chain implements the Ethereum Virtual Machine and supports Solidity smart contracts as well as most other Ethereum client functionality.
15
15
@@ -44,11 +44,11 @@ The Subnet EVM supports the following API namespaces:
44
44
45
45
Only the `eth` namespace is enabled by default.
46
46
Subnet EVM is a simplified version of [Coreth VM (C-Chain)](https://github.com/ava-labs/coreth).
47
-
Full documentation for the C-Chain's API can be found [here](https://build.avax.network/docs/api-reference/c-chain/api).
47
+
Full documentation for the C-Chain's API can be found in the [builder docs](https://build.avax.network/docs/rpcs/c-chain).
48
48
49
49
## Compatibility
50
50
51
-
The SubnetEVM is compatible with almost all Ethereum tooling, including [Remix](https://docs.avax.network/build/dapp/smart-contracts/remix-deploy), [Metamask](https://docs.avax.network/build/dapp/chain-settings), and [Foundry](https://docs.avax.network/build/dapp/smart-contracts/toolchains/foundry).
51
+
Subnet-EVM is compatible with almost all Ethereum tooling, including [Foundry](https://build.avax.network/academy/blockchain/solidity-foundry/03-smart-contracts/03-foundry-quickstart) and [Remix](https://build.avax.network/docs/avalanche-l1s/add-utility/deploy-smart-contract#using-remix).
52
52
53
53
**Note:** Subnet-EVM and Avalanche C-Chain currently implement the Ethereum Cancun fork and do not yet support newer hardforks (such as Pectra). Since Solidity v0.8.30 switched its default target EVM version to Pectra, contracts compiled with default settings may emit bytecode using instructions/features that Avalanche does not support.
54
54
To avoid this mismatch, explicitly set the Solidity compiler’s `evmVersion` to `cancun` when deploying to Subnet-EVM or the C-Chain.
@@ -73,7 +73,7 @@ To support these changes, there have been a number of changes to the SubnetEVM b
73
73
74
74
### Clone Subnet-evm
75
75
76
-
First install Go 1.24.9 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
76
+
First install Go 1.24.9 or later. Follow the instructions on the [go docs](https://go.dev/doc/install). You can verify by running `go version`.
77
77
78
78
Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Please read [this](https://go.dev/doc/code) for details. You can verify by running `echo $GOPATH`.
79
79
@@ -97,8 +97,8 @@ To run a local network, it is recommended to use the [avalanche-cli](https://git
97
97
98
98
There are two options when using the Avalanche-CLI:
99
99
100
-
1. Use an official Subnet-EVM release: <https://docs.avax.network/subnets/build-first-subnet>
101
-
2. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: <https://docs.avax.network/subnets/create-custom-subnet>
100
+
1. Use an official Subnet-EVM release: <https://build.avax.network/docs/tooling/avalanche-cli/create-avalanche-l1>
101
+
1. Build and deploy a locally built (and optionally modified) version of Subnet-EVM: <https://build.avax.network/docs/tooling/avalanche-cli/create-deploy-avalanche-l1s/deploy-with-custom-vm>
@@ -201,7 +203,7 @@ The plugin version is unchanged at 37 and is compatible with AvalancheGo version
201
203
- Added following new database options:
202
204
-`"use-standalone-database"` (`bool`): If true it enables creation of standalone database. If false it uses the GRPC Database provided by AvalancheGo. Default is nil and creates the standalone database only if there is no accepted block in the AvalancheGo database (node has not accepted any blocks for this chain)
203
205
-`"database-type"` (`string`): Specifies the type of database to use. Must be one of `pebbledb`, `leveldb` or `memdb`. memdb is an in-memory, non-persisted database. Default is `pebbledb`
204
-
-`"database-config-file"` (`string`): Path to the database config file. Config file is changed for every database type. See [docs](https://docs.avax.network/api-reference/avalanche-go-configs-flags#database-config) for available configs per database type. Ignored if --config-file-content is specified
206
+
-`"database-config-file"` (`string`): Path to the database config file. Config file is changed for every database type. See [docs](https://build.avax.network/docs/nodes/configure/configs-flags#database-config) for available configs per database type. Ignored if --config-file-content is specified
205
207
-`"database-config-file-content"` (`string`): As an alternative to `database-config-file`, it allows specifying base64 encoded database config content
206
208
-`"database-path"` (`string`): Specifies the directory to which the standalone database is persisted. Defaults to "`$HOME/.avalanchego/chainData/{chainID}`"
207
209
-`"database-read-only"` (`bool`) : Specifies if the standalone database should be a read-only type. Defaults to false
Copy file name to clipboardExpand all lines: cmd/precompilegen/template-readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@ There are some must-be-done changes waiting in the generated file. Each area req
2
2
Additionally there are other files you need to edit to activate your precompile.
3
3
These areas are highlighted with comments "ADD YOUR PRECOMPILE HERE".
4
4
For testing take a look at other precompile tests in contract_test.go and config_test.go in other precompile folders.
5
-
See the tutorial in <https://docs.avax.network/subnets/hello-world-precompile-tutorial> for more information about precompile development.
5
+
See the tutorial in <https://build.avax.network/academy/blockchain/solidity-foundry/04-hello-world-part-1/01-intro> for more information about precompile development.
Copy file name to clipboardExpand all lines: cmd/simulator/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,11 @@ To confirm that you built successfully, run the simulator and print the version:
24
24
25
25
This should give the following output:
26
26
27
-
```
27
+
```bash
28
28
v0.1.0
29
29
```
30
30
31
-
To run the load simulator, you must first start an EVM based network. The load simulator works on both the C-Chain and Subnet-EVM, so we will start a single node network and run the load simulator on the C-Chain.
31
+
To run the load simulator, you must first start an EVM based network. The load simulator works on both the C-Chain and Subnet-EVM, so we will start a single node network and run the load simulator on a Subnet-EVM blockchain.
32
32
33
33
To start a single node network, follow the instructions from the AvalancheGo [README](https://github.com/ava-labs/avalanchego#building-avalanchego) to build from source.
34
34
@@ -45,9 +45,9 @@ The `--sybil-protection-enabled=false` flag is only suitable for local testing.
45
45
1. Ignore stake weight on the P-Chain and count each connected peer as having a stake weight of 1
46
46
2. Automatically opts in to validate every Subnet
47
47
48
-
Once you have AvalancheGo running locally, it will be running an HTTP Server on the default port `9650`. This means that the RPC Endpoint for the C-Chain will be http://127.0.0.1:9650/ext/bc/C/rpc and ws://127.0.0.1:9650/ext/bc/C/ws for WebSocket connections.
48
+
Once you have AvalancheGo running locally, it will be running an HTTP Server on the default port `9650`. This means that the RPC Endpoint for your Subnet-EVM blockchain will be `http://127.0.0.1:9650/ext/bc/BLOCKCHAIN_ID/rpc` and `ws://127.0.0.1:9650/ext/bc/BLOCKCHAIN_ID/ws` for WebSocket connections, where `BLOCKCHAIN_ID` is the blockchain ID of your deployed Subnet-EVM instance.
49
49
50
-
Now, we can run the simulator command to simulate some load on the local C-Chain for 30s:
50
+
Now, we can run the simulator command to simulate some load on the local Subnet-EVM blockchain:
Copy file name to clipboardExpand all lines: consensus/dummy/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Consensus
2
2
3
-
Disclaimer: the consensus package in subnet-evm is a complete misnomer.
3
+
Disclaimer: the consensus package in Subnet-EVM is a complete misnomer.
4
4
5
5
The consensus package in go-ethereum handles block validation and specifically handles validating the PoW portion of consensus - thus the name.
6
6
@@ -12,7 +12,7 @@ The dummy consensus engine is responsible for performing verification on the hea
12
12
13
13
## Dynamic Fees
14
14
15
-
Subnet-EVM includes a dynamic fee algorithm based off of (EIP-1559)[https://eips.ethereum.org/EIPS/eip-1559]. This introduces a field to the block type called `BaseFee`. The Base Fee sets a minimum gas price for any transaction to be included in the block. For example, a transaction with a gas price of 49 gwei, will be invalid to include in a block with a base fee of 50 gwei.
15
+
Subnet-EVM includes a dynamic fee algorithm based off of [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559). This introduces a field to the block type called `BaseFee`. The Base Fee sets a minimum gas price for any transaction to be included in the block. For example, a transaction with a gas price of 49 gwei, will be invalid to include in a block with a base fee of 50 gwei.
16
16
17
17
The dynamic fee algorithm aims to adjust the base fee to handle network congestion. Subnet-EVM sets a target utilization on the network, and the dynamic fee algorithm adjusts the base fee accordingly. If the network operates above the target utilization, the dynamic fee algorithm will increase the base fee to make utilizing the network more expensive and bring overall utilization down. If the network operates below the target utilization, the dynamic fee algorithm will decrease the base fee to make it cheaper to use the network.
18
18
@@ -30,4 +30,4 @@ The FinalizeAndAssemble callback is used as the final step in building a block w
30
30
31
31
### Finalize
32
32
33
-
Finalize is called as the final step in processing a block [here](../../core/state_processor.go). Since either Finalize or FinalizeAndAssemble are called, but not both, when building or verifying/processing a block they need to perform the exact same processing/verification step to ensure that a block produced by the miner where FinalizeAndAssemble is called will be processed and verified in the same way when Finalize gets called.
33
+
Finalize is called as the final step in processing a block in [state_processor.go](../../core/state_processor.go). Since either Finalize or FinalizeAndAssemble are called, but not both, when building or verifying/processing a block they need to perform the exact same processing/verification step to ensure that a block produced by the miner where FinalizeAndAssemble is called will be processed and verified in the same way when Finalize gets called.
0 commit comments