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

Optimism plugin #6146

Merged
merged 113 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
b0b1ee4
Add OP Deposit TxType and Tx fields
jmederosalvarado Jun 13, 2023
892446b
Add Optimism plugin
jmederosalvarado Jun 13, 2023
1aa37c2
Add deposit tx rlp decoding and encoding
jmederosalvarado Jun 13, 2023
edb70f0
Start adding chainspec style for optimism
jmederosalvarado Jun 19, 2023
278ee45
Start l1 tx cost implementation
jmederosalvarado Jun 19, 2023
551fd2e
Refactors and setting up optimism plugin
LukaszRozmej Jun 27, 2023
a44018a
Some custom state transition logic
jmederosalvarado Jun 28, 2023
96e7621
state transition logic
jmederosalvarado Jul 6, 2023
1e12ad4
Merge branch 'master' into optimism
jmederosalvarado Jul 6, 2023
71d4451
Commit
jmederosalvarado Jul 26, 2023
0f45c46
Merge branch 'master' into optimism
Jul 29, 2023
85a0b07
Fix build
Jul 29, 2023
98b3062
Merge branch 'master' into optimism
Aug 1, 2023
0395c04
Merge branch 'master' into optimism
Aug 4, 2023
310c495
Fix Aura & add config
Aug 11, 2023
6364429
Merge branch 'master' into optimism
Aug 14, 2023
c9ff666
Add plugin to Runner
Aug 15, 2023
bc9a0b2
Make it run
Aug 17, 2023
3555d2a
No state in genesis
deffrian Aug 29, 2023
251c1d4
sync state & old headers
deffrian Aug 29, 2023
9b93811
Bodies & receipts
deffrian Sep 8, 2023
ccda6d8
Finalized fix
deffrian Sep 10, 2023
a36d1f4
Move to chainspec based OP config
jmederosalvarado Sep 11, 2023
0c8c091
Enable OptimismEngineModule
jmederosalvarado Sep 11, 2023
a864d95
OP Specific way of building empty blocks
jmederosalvarado Sep 11, 2023
2433605
Op post merge block producer empty block refactor
jmederosalvarado Sep 11, 2023
928bd74
Revert "Enable OptimismEngineModule"
jmederosalvarado Sep 11, 2023
a2bbf2f
use OptimismEngineModule
jmederosalvarado Sep 11, 2023
a5ffd84
plugin order
jmederosalvarado Sep 12, 2023
5f0b45d
OptimismTxValidator
jmederosalvarado Sep 12, 2023
2062012
Ignore gas limit
deffrian Sep 12, 2023
289e86b
Optimism plugin no longer inherits from MergePlugin
jmederosalvarado Sep 12, 2023
87ccc7f
Add txProcessorFactory
deffrian Sep 14, 2023
fde52bc
Work on OptimismBlockProducerEnvFactory
jmederosalvarado Sep 14, 2023
21ecb24
Don't touch account on substracting zero from balance
jmederosalvarado Sep 14, 2023
c9288e9
Update transaction ToString for better debugging
jmederosalvarado Sep 14, 2023
59dda3b
skip refunds and fees in deposit txs
jmederosalvarado Sep 14, 2023
c056051
Fix DepositTx signature encoding
jmederosalvarado Sep 19, 2023
e9c5c30
Log OP payload attrs fields
jmederosalvarado Sep 19, 2023
3e6d981
Throw if asks for l1 gas cost
jmederosalvarado Sep 19, 2023
5b61594
fix parenthesis in OP payload attrs toString
jmederosalvarado Sep 19, 2023
0a9697d
Fix Extradata and Nonce
jmederosalvarado Sep 19, 2023
f51bd01
Fix Gas refunds for Depost Txs
jmederosalvarado Sep 19, 2023
ee8fee4
Implement L1Cost function
jmederosalvarado Sep 19, 2023
1f55d20
Fix RecoverSignature preprocessing step
jmederosalvarado Sep 19, 2023
28d78a7
Fix nonce incrementing twice
jmederosalvarado Sep 19, 2023
ec47c01
Make Rpc Transaction work with Depost Type
jmederosalvarado Sep 20, 2023
2a85b33
Fix tx picker when producing blocks in optimism
jmederosalvarado Sep 20, 2023
87a0950
skip block improvement for deposit-only payloads
jmederosalvarado Sep 20, 2023
1971b51
invert noTxPool checks
jmederosalvarado Sep 20, 2023
60bff23
Remove unnecessary evm call override in op tx processor
jmederosalvarado Sep 20, 2023
2ed4dd8
Regolith timestamp & td validation
deffrian Sep 20, 2023
61016bf
IsOpSystemTransaction
deffrian Sep 20, 2023
c120bd6
Fix 1559 fee collector
deffrian Sep 20, 2023
ed13c3c
BlockTree load ForkChoice info
jmederosalvarado Sep 21, 2023
4b28f76
simplify config and chainspec for op-goerli
jmederosalvarado Sep 21, 2023
4729d4f
Add some logging to LoadForkChoice info
jmederosalvarado Sep 21, 2023
22d5a5d
Fix rpc tx
jmederosalvarado Sep 22, 2023
ae1bc0a
some logging (commented out for now)
jmederosalvarado Sep 22, 2023
6025c17
fix logging in OP payload attrs
jmederosalvarado Sep 22, 2023
150b017
Increment nonce on invalid deposit
deffrian Sep 25, 2023
9a946b0
reenable networking
jmederosalvarado Sep 25, 2023
b2236e7
Add base goerli config
jmederosalvarado Sep 26, 2023
c312391
add author to base goerli genesis
jmederosalvarado Sep 26, 2023
7388d81
fix activated at in builtins
jmederosalvarado Sep 26, 2023
2350f5c
fix chainspec for base-goerli.json
jmederosalvarado Sep 26, 2023
f1c2763
Merge branch 'master' into optimism-master
jmederosalvarado Sep 26, 2023
8bb2960
Update submodules to master version
jmederosalvarado Sep 26, 2023
44f52aa
change payload id computation
jmederosalvarado Sep 26, 2023
ec01f80
Add base mainnet
jmederosalvarado Sep 27, 2023
aefa3f2
Op mainnet
deffrian Sep 28, 2023
ee99edc
Op-mainnet config change
deffrian Sep 29, 2023
f3bb026
Merge branch 'optimism' into optimism-master
deffrian Sep 29, 2023
c23b09d
Remove todos
deffrian Oct 5, 2023
4b56c32
Fix formatting
deffrian Oct 5, 2023
28ca9bb
Fix build
deffrian Oct 5, 2023
22a0480
Change encoding
deffrian Oct 5, 2023
1127960
Add root
deffrian Oct 5, 2023
a634e07
Revert "Add root"
deffrian Oct 5, 2023
5db5f6a
Merge branch 'master' into optimism-master
deffrian Oct 5, 2023
a02f24f
Revert "Remove todos"
deffrian Oct 5, 2023
bbd8082
Fix build
deffrian Oct 6, 2023
a5930ff
Remove todos
deffrian Oct 5, 2023
998b97b
Fix overflow
deffrian Oct 7, 2023
a80688a
Fix payload ids in tests
deffrian Oct 8, 2023
938d401
Fix init tests
deffrian Oct 8, 2023
18295c9
Fix null api
deffrian Oct 9, 2023
0176a3e
Fix proof test
deffrian Oct 9, 2023
6d86f33
Fix aura payloadId
deffrian Oct 9, 2023
a9a9a9f
Cleanup
deffrian Oct 9, 2023
fc6a84c
Fix goerli ttd
deffrian Oct 10, 2023
28005a3
Enable GC on newPayload
deffrian Oct 12, 2023
1e8b22d
Merge branch 'master' into optimism-master
deffrian Oct 12, 2023
7de7856
Fix build
deffrian Oct 12, 2023
e714e1a
Fix formatting
deffrian Oct 12, 2023
571d76e
Change to task delay
deffrian Oct 13, 2023
8ae3d9f
Fix RecoverAddress
deffrian Oct 16, 2023
5f36746
Merge branch 'master' into optimism-master
deffrian Oct 19, 2023
d673f25
Fix minor issues
deffrian Oct 20, 2023
1d712a8
Fix build
deffrian Oct 20, 2023
8eecc0a
feeRecipient & blockAddress in chainspec
deffrian Oct 20, 2023
85b313a
Optimism ecdsa
deffrian Oct 23, 2023
05e3fc6
Fix AlwaysPos
deffrian Oct 23, 2023
8deec98
Filter transactions
deffrian Oct 23, 2023
2abc62c
Cash l1datacost
deffrian Oct 23, 2023
f07a81f
Small fixes
deffrian Oct 23, 2023
44bb530
Remove AllowUnsafeBlocks
deffrian Oct 24, 2023
117021c
Remove TxProcessorFactory
deffrian Oct 24, 2023
c491686
Move SetupBlockchainProcessorInterceptor
deffrian Oct 24, 2023
a9ebf99
NeverProduceTrigger
deffrian Oct 25, 2023
4e0a06c
InitializeBlockProducerOptimism
deffrian Oct 25, 2023
9986f31
Validate payload attributes
deffrian Oct 25, 2023
81bf2d3
Init SpecHelper & L1CostHelper
deffrian Oct 25, 2023
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
15,352 changes: 15,352 additions & 0 deletions src/Nethermind/Chains/base-goerli.json

Large diffs are not rendered by default.

14,587 changes: 14,587 additions & 0 deletions src/Nethermind/Chains/base-mainnet.json

Large diffs are not rendered by default.

167 changes: 167 additions & 0 deletions src/Nethermind/Chains/op-goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"name": "Optimism goerli",
"dataDir": "op-goerli",
"engine": {
"Optimism": {
"params": {
"regolithTimestamp": "0x6414B8B0",
"bedrockBlockNumber": "0x0"
}
}
},
"params": {
"chainId": "0x1a4",
"gasLimitBoundDivisor": "0x400",
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"forkBlock": "0x0",
"maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0x0",
"eip150Transition": "0x0",
"eip160Transition": "0x0",
"eip161abcTransition": "0x0",
"eip161dTransition": "0x0",
"eip155Transition": "0x0",
"eip140Transition": "0x0",
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip658Transition": "0x0",
"eip145Transition": "0x0",
"eip1014Transition": "0x0",
"eip1052Transition": "0x0",
"eip1283Transition": "0x0",
"eip1283DisableTransition": "0x0",
"eip152Transition": "0x0",
"eip1108Transition": "0x0",
"eip1344Transition": "0x0",
"eip1884Transition": "0x0",
"eip2028Transition": "0x0",
"eip2200Transition": "0x0",
"eip2565Transition": "0x0",
"eip2929Transition": "0x0",
"eip2930Transition": "0x0",
"eip1559Transition": "0x3df828",
"eip1559FeeCollectorTransition": "0x3df828",
"eip1559FeeCollector": "0x4200000000000000000000000000000000000019",
"eip1559ElasticityMultiplier": "0xa",
"eip1559BaseFeeMaxChangeDenominator": "0x32",
"eip3198Transition": "0x3df828",
"eip3529Transition": "0x3df828",
"eip3541Transition": "0x3df828",

"terminalTotalDifficulty": "0"
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"difficulty": "0x1",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x000000000000000000000000000000000000000000000000000000000000000027770a9694e4b4b1e130ab91bc327c36855f612e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xe4e1c0",
"stateUnavailable": true,
"stateRoot": "0x9e6b478a1cd331a979c39e4bddf42c676bcf5a63382f898dc441fe3fe5eb0837"
},
"nodes": [
],
"accounts": {
"0x0000000000000000000000000000000000000001": {
"builtin": {
"name": "ecrecover",
"pricing": {
"linear": {
"base": 3000,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000002": {
"builtin": {
"name": "sha256",
"pricing": {
"linear": {
"base": 60,
"word": 12
}
}
}
},
"0x0000000000000000000000000000000000000003": {
"builtin": {
"name": "ripemd160",
"pricing": {
"linear": {
"base": 600,
"word": 120
}
}
}
},
"0x0000000000000000000000000000000000000004": {
"builtin": {
"name": "identity",
"pricing": {
"linear": {
"base": 15,
"word": 3
}
}
}
},
"0x0000000000000000000000000000000000000005": {
"builtin": {
"name": "modexp",
"activate_at": "0x42ae50",
"pricing": {
"modexp": {
"divisor": 20
}
}
}
},
"0x0000000000000000000000000000000000000006": {
"builtin": {
"name": "alt_bn128_add",
"activate_at": "0x42ae50",
"pricing": {
"linear": {
"base": 500,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000007": {
"builtin": {
"name": "alt_bn128_mul",
"activate_at": "0x42ae50",
"pricing": {
"linear": {
"base": 40000,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000008": {
"builtin": {
"name": "alt_bn128_pairing",
"activate_at": "0x42ae50",
"pricing": {
"alt_bn128_pairing": {
"base": 100000,
"pair": 80000
}
}
}
}
}
}
167 changes: 167 additions & 0 deletions src/Nethermind/Chains/op-mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"name": "Optimism Mainnet",
"dataDir": "op-mainnet",
"engine": {
"Optimism": {
"params": {
"regolithTimestamp": "0x0",
"bedrockBlockNumber": "0x645C277"
}
}
},
"params": {
"chainId": "0xa",
"gasLimitBoundDivisor": "0x400",
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"forkBlock": "0x0",
"maxCodeSize": "0x6000",
"maxCodeSizeTransition": "0x0",
"eip150Transition": "0x0",
"eip160Transition": "0x0",
"eip161abcTransition": "0x0",
"eip161dTransition": "0x0",
"eip155Transition": "0x0",
"eip140Transition": "0x0",
"eip211Transition": "0x0",
"eip214Transition": "0x0",
"eip658Transition": "0x0",
"eip145Transition": "0x0",
"eip1014Transition": "0x0",
"eip1052Transition": "0x0",
"eip1283Transition": "0x0",
"eip1283DisableTransition": "0x0",
"eip152Transition": "0x0",
"eip1108Transition": "0x0",
"eip1344Transition": "0x0",
"eip1884Transition": "0x0",
"eip2028Transition": "0x0",
"eip2200Transition": "0x0",
"eip2565Transition": "0x3C45B0",
"eip2929Transition": "0x3C45B0",
"eip2930Transition": "0x3C45B0",
"eip1559Transition": "0x645C277",
"eip1559FeeCollectorTransition": "0x645C277",
"eip1559FeeCollector": "0x4200000000000000000000000000000000000019",
"eip1559ElasticityMultiplier": "0x6",
"eip1559BaseFeeMaxChangeDenominator": "0x32",
"eip3198Transition": "0x645C277",
"eip3529Transition": "0x645C277",
"eip3541Transition": "0x645C277",

"terminalTotalDifficulty": "0"
},
"genesis": {
"seal": {
"ethereum": {
"nonce": "0x0000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",
"difficulty": "0x1",
"author": "0x0000000000000000000000000000000000000000",
"timestamp": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x000000000000000000000000000000000000000000000000000000000000000000000398232e2064f896018496b4b44b3d62751f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xe4e1c0",
"stateUnavailable": true,
"stateRoot": "0xeddb4c1786789419153a27c4c80ff44a2226b6eda04f7e22ce5bae892ea568eb"
},
"nodes": [
],
"accounts": {
"0x0000000000000000000000000000000000000001": {
"builtin": {
"name": "ecrecover",
"pricing": {
"linear": {
"base": 3000,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000002": {
"builtin": {
"name": "sha256",
"pricing": {
"linear": {
"base": 60,
"word": 12
}
}
}
},
"0x0000000000000000000000000000000000000003": {
"builtin": {
"name": "ripemd160",
"pricing": {
"linear": {
"base": 600,
"word": 120
}
}
}
},
"0x0000000000000000000000000000000000000004": {
"builtin": {
"name": "identity",
"pricing": {
"linear": {
"base": 15,
"word": 3
}
}
}
},
"0x0000000000000000000000000000000000000005": {
"builtin": {
"name": "modexp",
"activate_at": "0x42ae50",
"pricing": {
"modexp": {
"divisor": 20
}
}
}
},
"0x0000000000000000000000000000000000000006": {
"builtin": {
"name": "alt_bn128_add",
"activate_at": "0x42ae50",
"pricing": {
"linear": {
"base": 500,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000007": {
"builtin": {
"name": "alt_bn128_mul",
"activate_at": "0x42ae50",
"pricing": {
"linear": {
"base": 40000,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000008": {
"builtin": {
"name": "alt_bn128_pairing",
"activate_at": "0x42ae50",
"pricing": {
"alt_bn128_pairing": {
"base": 100000,
"pair": 80000
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Nethermind.AccountAbstraction.Data;
using Nethermind.AccountAbstraction.Executor;
using Nethermind.Consensus;
using Nethermind.Consensus.Producers;
using Nethermind.Consensus.Transactions;
using Nethermind.Core;
using Nethermind.Core.Crypto;
Expand Down Expand Up @@ -54,7 +55,7 @@ public UserOperationTxSource(
_logger = logger;
}

public IEnumerable<Transaction> GetTransactions(BlockHeader parent, long gasLimit)
public IEnumerable<Transaction> GetTransactions(BlockHeader parent, long gasLimit, PayloadAttributes? payloadAttributes)
{
IDictionary<Address, HashSet<UInt256>> usedAccessList = new Dictionary<Address, HashSet<UInt256>>();
// IList<UserOperation> userOperationsToInclude = new List<UserOperation>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ namespace Nethermind.Api.Extensions;

public interface IPluginConfig : IConfig
{
[ConfigItem(Description = "Order of plugin initialization", DefaultValue = "[Clique, Aura, Ethash, AuRaMerge, Merge, MEV, HealthChecks, Hive]")]
[ConfigItem(Description = "Order of plugin initialization", DefaultValue = "[Clique, Aura, Ethash, Optimism, AuRaMerge, Merge, MEV, HealthChecks, Hive]")]
string[] PluginOrder { get; set; }
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/Extensions/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ namespace Nethermind.Api.Extensions;

public class PluginConfig : IPluginConfig
{
public string[] PluginOrder { get; set; } = { "Clique", "Aura", "Ethash", "AuRaMerge", "Merge", "MEV", "HealthChecks", "Hive" };
public string[] PluginOrder { get; set; } = { "Clique", "Aura", "Ethash", "Optimism", "AuRaMerge", "Merge", "MEV", "HealthChecks", "Hive" };
}
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Api/IApiWithBlockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface IApiWithBlockchain : IApiWithStores, IBlockchainBridgeFactory
IHealthHintService? HealthHintService { get; set; }
IRpcCapabilitiesProvider? RpcCapabilitiesProvider { get; set; }
ITransactionComparerProvider? TransactionComparerProvider { get; set; }
TxValidator? TxValidator { get; set; }
ITxValidator? TxValidator { get; set; }

/// <summary>
/// Manager of block finalization
Expand Down
3 changes: 3 additions & 0 deletions src/Nethermind/Nethermind.Api/IInitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public interface IInitConfig : IConfig
[ConfigItem(Description = "A hint for the max memory that will allow us to configure the DB and Netty memory allocations.", DefaultValue = "null")]
long? MemoryHint { get; set; }

[ConfigItem(Description = "[TECHNICAL] Disable garbage collector on newPayload", DefaultValue = "true", HiddenFromDocs = true)]
bool DisableGcOnNewPayload { get; set; }

[ConfigItem(Description = "[TECHNICAL] Disable setting malloc options. Set to true if using different memory allocator or manually setting malloc opts.", DefaultValue = "false", HiddenFromDocs = true)]
bool DisableMallocOpts { get; set; }
}
Expand Down
1 change: 1 addition & 0 deletions src/Nethermind/Nethermind.Api/InitConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class InitConfig : IInitConfig

public string RpcDbUrl { get; set; } = String.Empty;
public long? MemoryHint { get; set; }
public bool DisableGcOnNewPayload { get; set; } = true;
public bool DisableMallocOpts { get; set; } = false;

[Obsolete("Use DiagnosticMode with MemDb instead")]
Expand Down
Loading
Loading