Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sync 2024-01-19 #63

Merged
merged 132 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
7985488
Pause nitro node block validator validation when memory is running low
ganeshvanahalli Dec 13, 2023
7e4e4e7
address PR comments
ganeshvanahalli Dec 15, 2023
17512bf
Merge branch 'master' into blockvalidator-pause-validation
ganeshvanahalli Dec 15, 2023
fa44e50
add prunning test
magicxyyz Dec 14, 2023
875c558
add missing default value of InitConfig.Empty
magicxyyz Dec 15, 2023
efe6f05
Add loglevel for ephemeral errors, make data poster nonce ahead of on…
ganeshvanahalli Dec 15, 2023
ae5c2f2
cleanup imports
magicxyyz Dec 15, 2023
139063d
Merge branch 'master' into prunning-fix-test
magicxyyz Dec 15, 2023
f410e2f
resolve conflict
ganeshvanahalli Dec 18, 2023
12c99cc
Merge branch 'master' into add-ephemeralerror-loglevel
anodar Dec 18, 2023
e25a59e
fix typo
ganeshvanahalli Dec 18, 2023
abcb715
Merge branch 'master' into prunning-fix-test
magicxyyz Dec 18, 2023
6ca8516
fix arbitrum data db name in das test
magicxyyz Dec 19, 2023
18c1a2e
Merge branch 'master' into prunning-fix-test
magicxyyz Dec 19, 2023
a004659
Pass From field from dataposter to external signer
anodar Dec 19, 2023
e9f0104
Include accessList and chainID in signing requrest
anodar Dec 19, 2023
e52cdf1
Merge branch 'master' into dataposter_from_field
anodar Dec 20, 2023
a4b4bdd
Add a metric for memory used by the replay binary WASM in JIT
ganeshvanahalli Dec 20, 2023
7a26e97
clean up debug log
magicxyyz Dec 20, 2023
18f9e6c
Merge branch 'master' into prunning-fix-test
magicxyyz Dec 20, 2023
712bc0c
fix typo
magicxyyz Dec 20, 2023
d0cd917
Merge branch 'master' into metric-jit-wasm-memory
amsanghi Dec 20, 2023
b005bd0
count only state entries in diskdb in prunning test
magicxyyz Dec 20, 2023
83b9f7f
Merge branch 'master' into prunning-fix-test
magicxyyz Dec 20, 2023
a733e5a
Only lock redis in the batch poster when posting the batch
PlasmaPower Dec 20, 2023
4e73be7
Always broadcast feed, even when the node isn't the sequencer
PlasmaPower Dec 21, 2023
ae54e08
Add comment about PopulateFeedBacklog in seq coordinator being redundant
PlasmaPower Dec 21, 2023
29a8c85
Don't acquire redis lock in data poster
PlasmaPower Dec 21, 2023
fc62e91
Address PR comments and resolve merge conflict
ganeshvanahalli Dec 21, 2023
90ddc92
Implement test package for external signer, refactor existing tests, …
anodar Dec 21, 2023
e4e984a
Merge branch 'master' into dataposter_from_field
anodar Dec 21, 2023
11d76f6
Fix broadcastSegment Contains and its usage
PlasmaPower Dec 21, 2023
4b816bc
Further improve requestedSeqNum check
PlasmaPower Dec 21, 2023
4eeb994
Fix help text for batch limits
Tristan-Wilson Dec 21, 2023
ef9379b
Merge pull request #2045 from OffchainLabs/always-broadcast-feed
PlasmaPower Dec 22, 2023
e0382c4
Merge branch 'master' into batch-poster-lock-later
PlasmaPower Dec 22, 2023
8eccd0f
Add metrics for relay backlog size and backlog size in bytes
ganeshvanahalli Dec 22, 2023
603634d
Only use redis lock for DAS, not for normal batch posting
PlasmaPower Dec 22, 2023
063164e
Fix redis lock removal from staker config
PlasmaPower Dec 22, 2023
8f9bd0e
Fix simple redis lock test
PlasmaPower Dec 22, 2023
32883f1
fix typo
magicxyyz Dec 22, 2023
cb4d3c5
make only one test tx after pruning
magicxyyz Dec 22, 2023
e24cc5d
Merge branch 'master' into prunning-fix-test
magicxyyz Dec 22, 2023
51e9b55
Clean up code a bit to address two comments
PlasmaPower Dec 22, 2023
f546581
Merge pull request #2044 from OffchainLabs/batch-poster-lock-later
PlasmaPower Dec 22, 2023
ce3a425
fix typo
ganeshvanahalli Dec 23, 2023
5d12ab0
resolve merge conflicts
ganeshvanahalli Dec 23, 2023
c95a374
Stop execution node after everything else
PlasmaPower Dec 23, 2023
ac8dbc9
Log invalid txs in the STF when the chain is in debug mode
PlasmaPower Dec 23, 2023
8ab6625
Merge pull request #2050 from OffchainLabs/debug-invalid-txs
PlasmaPower Dec 23, 2023
23a836a
Merge branch 'master' into stop-execution-last
PlasmaPower Dec 23, 2023
af3cc2a
Merge branch 'master' into prunning-fix-test
Tristan-Wilson Dec 23, 2023
279dea4
Fix enabling pprof on the relay
PlasmaPower Dec 23, 2023
07710dc
Merge pull request #2021 from OffchainLabs/prunning-fix-test
Tristan-Wilson Dec 23, 2023
cacb641
Merge branch 'master' into fix-relay-pprof
PlasmaPower Dec 23, 2023
fef6581
Merge pull request #2051 from OffchainLabs/fix-relay-pprof
PlasmaPower Dec 23, 2023
e0f35dd
Fix memory leak in relay
PlasmaPower Dec 23, 2023
63bcedc
Merge pull request #2052 from OffchainLabs/fix-relay-memory-leak
PlasmaPower Dec 23, 2023
fd5edcb
Fix race conditions in backlog.reset()
PlasmaPower Dec 23, 2023
492e471
Merge pull request #2053 from OffchainLabs/backlog-reset-atomic
PlasmaPower Dec 23, 2023
d259717
Merge branch 'master' into stop-execution-last
PlasmaPower Dec 23, 2023
d7b8d02
Fix Broadcaster BroadcastMessages sequence numbers
PlasmaPower Dec 24, 2023
0b0f3e6
Merge branch 'master' into fix-broadcast-messages
PlasmaPower Dec 24, 2023
11cd4ef
Fix unused variable
PlasmaPower Dec 24, 2023
8f55e38
Merge pull request #2054 from OffchainLabs/fix-broadcast-messages
PlasmaPower Dec 24, 2023
96fe662
Revert "Merge pull request #2018 from OffchainLabs/linters"
PlasmaPower Dec 24, 2023
68917ae
Revert "Merge pull request #2016 from OffchainLabs/recursivelock-lint"
PlasmaPower Dec 24, 2023
6932d66
Merge pull request #2055 from OffchainLabs/revert-linters
PlasmaPower Dec 24, 2023
1fac15d
Fix sequencer forwarder panic on lack of targets
PlasmaPower Dec 27, 2023
66d00da
Merge pull request #2058 from OffchainLabs/fix-forwarder-panic
PlasmaPower Dec 27, 2023
966a172
Fix broken NodeInterface methods
PlasmaPower Dec 27, 2023
c75e604
Allow the TxForwarder to be empty
PlasmaPower Dec 27, 2023
2f9c34d
Merge pull request #2059 from OffchainLabs/fix-node-interface
PlasmaPower Dec 27, 2023
f6b8ca2
Merge branch 'master' into allow-empty-forwarder
PlasmaPower Dec 27, 2023
02bfe08
Fix comment
PlasmaPower Dec 27, 2023
8f33fea
Merge pull request #2060 from OffchainLabs/allow-empty-forwarder
PlasmaPower Dec 27, 2023
3d4111c
update change date
Dec 30, 2023
172765d
update license year
Dec 30, 2023
e208616
Hide error when getting latest confirmed block
PlasmaPower Jan 2, 2024
2142d5f
Merge pull request #2063 from OffchainLabs/hide-finalized-err
PlasmaPower Jan 2, 2024
1a7ff92
Merge branch 'master' into add-ephemeralerror-loglevel
ganeshvanahalli Jan 2, 2024
ef961ae
enable EphemeralErrorHandler to ignore error for a certain duration
ganeshvanahalli Jan 2, 2024
b193262
code refactor
ganeshvanahalli Jan 2, 2024
ef9b15e
Merge branch 'master' into metric-jit-wasm-memory
joshuacolvin0 Jan 5, 2024
e8ec476
Make clippy happy
joshuacolvin0 Jan 5, 2024
b9e9bcf
Make clippy happy
joshuacolvin0 Jan 5, 2024
1e54d74
Merge branch 'master' into blockvalidator-pause-validation
ganeshvanahalli Jan 5, 2024
c02e840
address PR comments
ganeshvanahalli Jan 5, 2024
70056c3
Merge branch 'master' into relay-backlogsize-metrics
ganeshvanahalli Jan 5, 2024
cc89883
address PR comments
ganeshvanahalli Jan 5, 2024
5362990
Merge pull request #2043 from OffchainLabs/metric-jit-wasm-memory
joshuacolvin0 Jan 5, 2024
cb777cb
Merge branch 'master' into change-date-2028
joshuacolvin0 Jan 5, 2024
d0624ec
Merge pull request #2062 from OffchainLabs/change-date-2028
joshuacolvin0 Jan 5, 2024
1b27ae0
Merge branch 'master' into batch-limit-help-text
joshuacolvin0 Jan 5, 2024
6ee273e
Merge pull request #2046 from OffchainLabs/batch-limit-help-text
joshuacolvin0 Jan 5, 2024
f23e24d
Merge branch 'master' into stop-execution-last
joshuacolvin0 Jan 5, 2024
8565937
Merge pull request #2049 from OffchainLabs/stop-execution-last
joshuacolvin0 Jan 5, 2024
a3dcd7c
Merge branch 'master' into add-ephemeralerror-loglevel
amsanghi Jan 7, 2024
521fe53
Merge pull request #2020 from OffchainLabs/add-ephemeralerror-loglevel
ganeshvanahalli Jan 7, 2024
6185dbf
Merge branch 'master' into dataposter_from_field
anodar Jan 8, 2024
8dc996c
Handle long sequencer URLs and fix fetching the list of live sequencers
ganeshvanahalli Jan 8, 2024
0e75be2
Merge branch 'master' into blockvalidator-pause-validation
ganeshvanahalli Jan 8, 2024
e065123
Merge pull request #2017 from OffchainLabs/blockvalidator-pause-valid…
ganeshvanahalli Jan 8, 2024
552939f
Fix getL1Confirmations on L3s
PlasmaPower Jan 8, 2024
c5ad12a
Merge branch 'master' into node-interface-l3-confs
PlasmaPower Jan 8, 2024
a211e2b
Fix test hitting panic if len(msgs)==0
PlasmaPower Jan 8, 2024
27d9d44
Merge pull request #2068 from OffchainLabs/node-interface-l3-confs
PlasmaPower Jan 10, 2024
f603002
Merge branch 'master' into dataposter_from_field
anodar Jan 10, 2024
5169b84
Pass parent chain id to createNode instead of making chainID call usi…
anodar Jan 10, 2024
bc3186f
Update go-ethereum pin
anodar Jan 11, 2024
8bc86c4
Merge branch 'master' into relay-backlogsize-metrics
ganeshvanahalli Jan 11, 2024
bbb8cf7
optimize impl and address PR comments
ganeshvanahalli Jan 11, 2024
4791a64
Merge branch 'master' into fix-liveliness-fetch
amsanghi Jan 11, 2024
9dd8556
address PR comments
ganeshvanahalli Jan 11, 2024
4bafeaf
Merge pull request #2067 from OffchainLabs/fix-liveliness-fetch
ganeshvanahalli Jan 11, 2024
5795e8a
Merge branch 'master' into dataposter_from_field
anodar Jan 11, 2024
80f2ac8
Merge pull request #2037 from OffchainLabs/dataposter_from_field
anodar Jan 11, 2024
d6e4f73
address PR comments
ganeshvanahalli Jan 11, 2024
8339ede
Merge branch 'master' into relay-backlogsize-metrics
ganeshvanahalli Jan 11, 2024
1e743ca
fix failing custom lint
ganeshvanahalli Jan 11, 2024
ce28683
Merge pull request #2048 from OffchainLabs/relay-backlogsize-metrics
PlasmaPower Jan 11, 2024
199fa1f
Add option to disable batch poster access lists
PlasmaPower Jan 12, 2024
46471c6
Merge branch 'master' into disable-access-lists
anodar Jan 14, 2024
7896f0d
Merge pull request #2077 from OffchainLabs/disable-access-lists
PlasmaPower Jan 14, 2024
44319b7
Add a check that the database chain id matches the config
PlasmaPower Jan 16, 2024
4dac708
Merge pull request #2078 from OffchainLabs/db-chain-id-check
PlasmaPower Jan 16, 2024
47c6024
Update readme and license for AEP
hkalodner Jan 18, 2024
f1e34a7
Fix typo in BSL
hkalodner Jan 18, 2024
4ad2693
Fix AEP link
hkalodner Jan 18, 2024
d6fc588
Merge branch 'master' of github.com:OffchainLabs/nitro into jh/sync-2…
ImJeremyHe Jan 19, 2024
9c2bd63
Bump espresso-sequencer-go
ImJeremyHe Jan 22, 2024
3b5c503
Fix the unparsing jst
ImJeremyHe Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,28 @@ Parameters
Licensor: Offchain Labs

Licensed Work: Arbitrum Nitro
The Licensed Work is (c) 2021-2023 Offchain Labs
The Licensed Work is (c) 2021-2024 Offchain Labs

Additional Use Grant: You may use the Licensed Work in a production environment solely
to provide a point of interface to permit end users or applications
utilizing the Covered Arbitrum Chains to interact and query the
state of a Covered Arbitrum Chain, including without limitation
validating the correctness of the posted chain state. For purposes
of this Additional Use Grant, the "Covered Arbitrum Chains" are
means (a) Arbitrum One (chainid:42161), Arbitrum Nova (chainid:42170),
Arbitrum Rinkeby testnet/Rinkarby (chainid:421611), and
Arbitrum Nitro Goerli testnet (chainid:421613) (b) any future
blockchains authorized to be designated as Covered Arbitrum Chains
by the decentralized autonomous organization governing the Arbitrum
network; and (c) any “Layer 3” Arbitrum-based blockchain that is built
on and settles to another Covered Arbitrum Chain.





Change Date: Dec 31, 2027
validating the correctness of the posted chain state, or to deploy
and operate (x) a blockchain that settles to a Covered Arbitrum Chain
or (y) a blockchain in accordance with, and subject to, the [Arbitrum
Expansion Program Term of Use](https://docs.arbitrum.foundation/assets/files/Arbitrum%20Expansion%20Program%20Jan182024-4f08b0c2cb476a55dc153380fa3e64b0.pdf). For purposes of this
Additional Use Grant, the "Covered Arbitrum Chains" are
(a) Arbitrum One (chainid:42161), Arbitrum Nova (chainid:42170),
rbitrum Rinkeby testnet/Rinkarby (chainid:421611),Arbitrum Nitro
Goerli testnet (chainid:421613), and Arbitrum Sepolia Testnet
(chainid:421614); (b) any future blockchains authorized to be
designated as Covered Arbitrum Chains by the decentralized autonomous
organization governing the Arbitrum network; and (c) any “Layer 3”
Arbitrum-based blockchain that is built on and settles to another
Covered Arbitrum Chain.


Change Date: Dec 31, 2028

Change License: Apache License Version 2.0

Expand Down
32 changes: 0 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -310,38 +310,6 @@ contracts/test/prover/proofs/%.json: $(arbitrator_cases)/%.wasm $(arbitrator_pro
# strategic rules to minimize dependency building

.make/lint: $(DEP_PREDICATE) build-node-deps $(ORDER_ONLY_PREDICATE) .make
go run ./linter/recursivelock ./...
go run ./linter/comparesame ./...

# Disabled since we have a lot of use of math/rand package.
# We should probably move to crypto/rand at some point even though most of
# our uses doesn't seem to be security sensitive.
# TODO fix this and enable.
# go run ./linter/cryptorand ./...

# This yields lot of legitimate warnings, most of which in practice would
# probably never happen.
# # TODO fix this and enable.
# go run ./linter/errcheck ./...

go run ./linter/featureconfig ./...

# Disabled since we have high cognitive complexity several places.
# TODO fix this and enable.
# go run ./linter/gocognit ./...

go run ./linter/ineffassign ./...
go run ./linter/interfacechecker ./...
go run ./linter/logruswitherror ./...

go run ./linter/shadowpredecl ./...
go run ./linter/slicedirect ./...

# Disabled since it fails many places, although ones I looked into seem
# to be false positives logically.
# TODO fix this and enable and mark false positives with lint ignore.
# go run ./linter/uintcast ./...

go run ./linter/koanf ./...
go run ./linter/pointercheck ./...
golangci-lint run --fix
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ Arbitrum One successfully migrated from the Classic Arbitrum stack onto Nitro on

## License

We currently have Nitro [licensed](./LICENSE) under a Business Source License, similar to our friends at Uniswap and Aave, with an "Additional Use Grant" to ensure that everyone can have full comfort using and running nodes on all public Arbitrum chains.
Nitro is currently licensed under a [Business Source License](./LICENSE), similar to our friends at Uniswap and Aave, with an "Additional Use Grant" to ensure that everyone can have full comfort using and running nodes on all public Arbitrum chains.

The Additional Use Grant also permits the deployment of the Nitro software, in a permissionless fashion and without cost, as a new blockchain provided that the chain settles to either Arbitrum One or Arbitrum Nova.

For those that prefer to deploy the Nitro software either directly on Ethereum (i.e. an L2) or have it settle to another Layer-2 on top of Ethereum, the [Arbitrum Expansion Program (the "AEP")](https://docs.arbitrum.foundation/assets/files/Arbitrum%20Expansion%20Program%20Jan182024-4f08b0c2cb476a55dc153380fa3e64b0.pdf) was recently established. The AEP allows for the permissionless deployment in the aforementioned fashion provided that 10% of net revenue (as more fully described in the AEP) is contributed back to the Arbitrum community in accordance with the requirements of the AEP.

## Contact

Expand Down
3 changes: 2 additions & 1 deletion arbitrator/jit/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ impl WasmEnv {
Ok(env)
}

pub fn send_results(&mut self, error: Option<String>) {
pub fn send_results(&mut self, error: Option<String>, memory_used: u64) {
let writer = match &mut self.process.socket {
Some((writer, _)) => writer,
None => return,
Expand All @@ -311,6 +311,7 @@ impl WasmEnv {
check!(socket::write_u64(writer, self.small_globals[1]));
check!(socket::write_bytes32(writer, &self.large_globals[0]));
check!(socket::write_bytes32(writer, &self.large_globals[1]));
check!(socket::write_u64(writer, memory_used));
check!(writer.flush());
}
}
Expand Down
3 changes: 2 additions & 1 deletion arbitrator/jit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ fn main() {
true => None,
false => Some(message),
};
let memory_used = memory.size().0 as u64 * 65_536;

env.send_results(error);
env.send_results(error, memory_used);
}

// require a usize be at least 32 bits wide
Expand Down
6 changes: 3 additions & 3 deletions arbitrator/jit/src/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ pub fn js_value_call(mut env: WasmEnvMut, sp: u32) -> MaybeEscape {

let value = match (object, method_name.as_slice()) {
(Ref(GO_ID), b"_makeFuncWrapper") => {
let arg = match args.get(0) {
let arg = match args.first() {
Some(arg) => arg,
None => fail!(
"Go trying to call Go._makeFuncWrapper with bad args {:?}",
Expand Down Expand Up @@ -415,7 +415,7 @@ pub fn js_value_call(mut env: WasmEnvMut, sp: u32) -> MaybeEscape {
(Ref(CRYPTO_ID), b"getRandomValues") => {
let name = "crypto.getRandomValues";

let id = match args.get(0) {
let id = match args.first() {
Some(Ref(x)) => x,
_ => fail!("Go trying to call {name} with bad args {:?}", args),
};
Expand Down Expand Up @@ -456,7 +456,7 @@ pub fn js_value_new(mut env: WasmEnvMut, sp: u32) {
let args_len = sp.read_u64(2);
let args = sp.read_value_slice(args_ptr, args_len);
match class {
UINT8_ARRAY_ID => match args.get(0) {
UINT8_ARRAY_ID => match args.first() {
Some(JsValue::Number(size)) => {
let id = pool.insert(DynamicObject::Uint8Array(vec![0; *size as usize]));
sp.write_u64(4, GoValue::Object(id).encode());
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl Module {
bin.memories.len() <= 1,
"Multiple memories are not supported"
);
if let Some(limits) = bin.memories.get(0) {
if let Some(limits) = bin.memories.first() {
let page_size = Memory::PAGE_SIZE;
let initial = limits.initial; // validate() checks this is less than max::u32
let allowed = u32::MAX as u64 / Memory::PAGE_SIZE - 1; // we require the size remain *below* 2^32
Expand Down
6 changes: 3 additions & 3 deletions arbitrator/wasm-libraries/go-stub/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub unsafe extern "C" fn go__syscall_js_valueNew(sp: GoStack) {
let args_len = sp.read_u64(2);
let args = read_value_slice(args_ptr, args_len);
if class == UINT8_ARRAY_ID {
if let Some(InterpValue::Number(size)) = args.get(0) {
if let Some(InterpValue::Number(size)) = args.first() {
let id = DynamicObjectPool::singleton()
.insert(DynamicObject::Uint8Array(vec![0; *size as usize]));
sp.write_u64(4, GoValue::Object(id).encode());
Expand Down Expand Up @@ -321,7 +321,7 @@ unsafe fn value_call_impl(sp: &mut GoStack) -> Result<GoValue, String> {
let args_len = sp.read_u64(4);
let args = read_value_slice(args_ptr, args_len);
if object == InterpValue::Ref(GO_ID) && &method_name == b"_makeFuncWrapper" {
let id = args.get(0).ok_or_else(|| {
let id = args.first().ok_or_else(|| {
format!(
"Go attempting to call Go._makeFuncWrapper with bad args {:?}",
args,
Expand Down Expand Up @@ -405,7 +405,7 @@ unsafe fn value_call_impl(sp: &mut GoStack) -> Result<GoValue, String> {
))
}
} else if object == InterpValue::Ref(CRYPTO_ID) && &method_name == b"getRandomValues" {
let id = match args.get(0) {
let id = match args.first() {
Some(InterpValue::Ref(x)) => *x,
_ => {
return Err(format!(
Expand Down
Loading
Loading