Skip to content

add validation module and snap sync config#365

Open
tanishqjasoria wants to merge 20 commits intomainfrom
sync/snap-config
Open

add validation module and snap sync config#365
tanishqjasoria wants to merge 20 commits intomainfrom
sync/snap-config

Conversation

@tanishqjasoria
Copy link
Copy Markdown

@tanishqjasoria tanishqjasoria commented Nov 4, 2025

Comment thread src/Nethermind.Arbitrum/Execution/ArbitrumHeaderValidator.cs
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds validation modules for Arbitrum-specific transaction types and configures snap sync settings for the Arbitrum Sepolia network. The changes enable proper validation of custom Arbitrum transaction types (internal, retryable, deposit, unsigned, and contract transactions) and set up snap sync parameters to improve synchronization performance.

Key Changes:

  • Added transaction validators for 6 Arbitrum-specific transaction types that currently accept all transactions
  • Added ArbitrumHeaderValidator that relaxes EIP-1559 validation and allows equal timestamps between blocks
  • Configured snap sync parameters (HeaderStateDistance, StateMaxDistanceFromHead, SnapServingMaxDepth) across Arbitrum Sepolia configs
  • Added genesis configuration support via hex-encoded config string and initial L1 base fee

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Nethermind.Arbitrum/Execution/Transactions/ArbitrumTxValidator.cs Added 6 transaction validator classes for Arbitrum-specific transaction types, all returning success without validation
src/Nethermind.Arbitrum/Execution/ArbitrumHeaderValidator.cs Added header validator that bypasses EIP-1559 validation and allows non-decreasing timestamps
src/Nethermind.Arbitrum/ArbitrumPlugin.cs Registered all transaction validators for custom Arbitrum transaction types and header validator
src/Nethermind.Arbitrum/Config/IArbitrumConfig.cs Added GenesisConfig and InitialL1BaseFee config properties, updated BlockProcessingTimeout description to milliseconds
src/Nethermind.Arbitrum/Config/ArbitrumConfig.cs Implemented new config properties with default values
src/Nethermind.Arbitrum/ArbitrumRpcModuleFactory.cs Added genesis initialization via DigestInitMessage when GenesisConfig is provided
src/Nethermind.Arbitrum/Properties/configs/arbitrum-sepolia.json Configured snap sync parameters, updated pruning boundary, added genesis config hex and initial L1 base fee, reduced FastSyncCatchUpHeightDelta
src/Nethermind.Arbitrum/Properties/configs/arbitrum-sepolia-archive.json Added snap sync configuration matching the non-archive config

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment thread src/Nethermind.Arbitrum/Execution/ArbitrumHeaderValidator.cs
Comment thread src/Nethermind.Arbitrum/Properties/configs/arbitrum-sepolia.json Outdated
Comment thread src/Nethermind.Arbitrum/Properties/configs/arbitrum-sepolia.json
Comment thread src/Nethermind.Arbitrum/Properties/configs/arbitrum-sepolia.json
Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 2, 2025

@tanishqjasoria I've opened a new pull request, #439, to work on those changes. Once the pull request is ready, I'll request review from you.

Comment on lines +21 to +36
public sealed class ArbitrumSubmitRetryableTxValidator: ITxValidator
{
public ValidationResult IsWellFormed(Transaction transaction, IReleaseSpec releaseSpec)
{
return ValidationResult.Success;
}
}

public sealed class ArbitrumRetryTxValidator: ITxValidator
{
public ValidationResult IsWellFormed(Transaction transaction, IReleaseSpec releaseSpec)
{
return ValidationResult.Success;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use Always.Valid?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might add some conditions here, so this acts as more of a placeholder for now.


namespace Nethermind.Arbitrum.Execution;

public class ArbitrumHeaderValidator(IBlockTree? blockTree, ISealValidator? sealValidator, ISpecProvider? specProvider, ILogManager? logManager) : HeaderValidator(blockTree, sealValidator, specProvider, logManager)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could consider decorator, probably both are fine

Copy link
Copy Markdown
Author

@tanishqjasoria tanishqjasoria Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but then i would have to implement the IHeaderValidator.Validate function, here i am just overiding two functions

"Blocks": {
"PreWarmStateOnBlockProcessing": false,
"BuildBlocksOnMainState": true
"BuildBlocksOnMainState": false
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for disabling this? Is there a conflict here with serving snap data?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this was causing some issues - i think we discussed this as well before - something to do with generting wrong snapshot for syncing

{
ILogger logger = logManager.GetClassLogger<ArbitrumRpcModule>();
if (logger.IsInfo)
logger.Info($"Block hash verification enabled: verify every {verifyBlockHashConfig.VerifyEveryNBlocks} blocks, url={verifyBlockHashConfig.ArbNodeRpcUrl}");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires merge or rebasing as this change has already been merged

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which change exactly? this is just moving this part under the else statement.

logManager, cachedL1PriceData, processingQueue, arbitrumConfig, verifyBlockHashConfig, jsonSerializer, blocksConfig, processExitSource);
}

if (arbitrumConfig.GenesisConfig is not null)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damian-orzechowski this is the main change here

@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Health
Nethermind.Arbitrum 80% 57%
Summary 80% (8246 / 10300) 57% (1988 / 3498)

Minimum allowed line rate is 60%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants