Skip to content

Commit

Permalink
feat: remove data stream from sequence sender (#63)
Browse files Browse the repository at this point in the history
* feat: implement batch interface

* feat: update sync lib

* feat: enable test

* feat: update config files

* feat: fix test

* feat: fix test

* feat: batch string method

* feat: update kurtosis commit

* fix: comments

* fix: comments

* fix: linter

* fix: vars

* fix: error return

* fix: regex

* fix: hex to to bytes

* feat: update kurtosis template
  • Loading branch information
ToniRamirezM authored Oct 1, 2024
1 parent 473cc88 commit ba2b077
Show file tree
Hide file tree
Showing 12 changed files with 752 additions and 1,083 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/test-resequence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
# Disable test for the moment as it takes too long
- "this-test-is-disabled"
- "test_disabled"


concurrency:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: 0xPolygon/kurtosis-cdk
ref: 3debe0a4dd000e02f7e6bde3247432211bf0336f
ref: a7a80b7b5d98a69a23415ab0018e556257a6dfb6
path: kurtosis-cdk

- name: Install Kurtosis CDK tools
Expand Down Expand Up @@ -72,8 +72,11 @@ jobs:
- name: Configure Kurtosis CDK
working-directory: ./kurtosis-cdk
run: |
/usr/local/bin/yq -i '.args.cdk_erigon_node_image = "jerrycgh/cdk-erigon:d5d04906f723f3f1d8c43c9e6baf3e18c27ff348"' params.yml
/usr/local/bin/yq -i '.args.cdk_node_image = "cdk:local"' params.yml
/usr/local/bin/yq -i '.args.zkevm_rollup_fork_id = "12"' params.yml
/usr/local/bin/yq -i '.args.zkevm_prover_image = "hermeznetwork/zkevm-prover:v8.0.0-RC5-fork.12"' params.yml
/usr/local/bin/yq -i '.args.cdk_erigon_node_image = "jerrycgh/cdk-erigon:d5d04906f723f3f1d8c43c9e6baf3e18c27ff348"' params.yml
- name: Deploy Kurtosis CDK package
working-directory: ./kurtosis-cdk
Expand Down
8 changes: 1 addition & 7 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1875,13 +1875,7 @@ func (a *Aggregator) getWitness(batchNumber uint64, url string, fullWitness bool
return nil, err
}

witnessString := strings.TrimLeft(witness, "0x")
if len(witnessString)%2 != 0 {
witnessString = "0" + witnessString
}
bytes := common.Hex2Bytes(witnessString)

return bytes, nil
return common.FromHex(witness), nil
}

func printInputProver(logger *log.Logger, inputProver *prover.StatelessInputProver) {
Expand Down
4 changes: 2 additions & 2 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ WaitPeriodPurgeTxFile = "15m"
MaxPendingTx = 1
MaxBatchesForL1 = 300
BlockFinality = "FinalizedBlock"
[SequenceSender.StreamClient]
Server = "127.0.0.1:6900"
RPCURL = ""
GetBatchWaitInterval = "10s"
[SequenceSender.EthTxManager]
FrequencyToMonitorTxs = "1s"
WaitTxToBeMined = "2m"
Expand Down
1 change: 1 addition & 0 deletions sequencesender.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 5 additions & 5 deletions sequencesender/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ type Config struct {
// MaxPendingTx is the maximum number of pending transactions (those that are not in a final state)
MaxPendingTx uint64

// StreamClient is the config for the stream client
StreamClient StreamClientCfg `mapstructure:"StreamClient"`

// EthTxManager is the config for the ethtxmanager
EthTxManager ethtxmanager.Config `mapstructure:"EthTxManager"`

Expand All @@ -68,8 +65,11 @@ type Config struct {
// BlockFinality indicates the status of the blocks that will be queried in order to sync
BlockFinality string `jsonschema:"enum=LatestBlock, enum=SafeBlock, enum=PendingBlock, enum=FinalizedBlock, enum=EarliestBlock" mapstructure:"BlockFinality"` //nolint:lll

// SanityCheckRPCURL is the URL of the RPC server to perform sanity check regarding the number of blocks in a batch
SanityCheckRPCURL string `mapstructure:"SanityCheckRPCURL"`
// RPCURL is the URL of the RPC server
RPCURL string `mapstructure:"RPCURL"`

// GetBatchWaitInterval is the time to wait to query for a new batch when there are no more batches available
GetBatchWaitInterval types.Duration `mapstructure:"GetBatchWaitInterval"`
}

// StreamClientCfg contains the data streamer's configuration properties
Expand Down
Loading

0 comments on commit ba2b077

Please sign in to comment.