forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
synchronizer accepts empty closed batches from trusted depending on c…
…onfig (0xPolygonHermez#3370) * accept empty closed batches depending on config * if trusted synchronization dont create L2 sync classes
- Loading branch information
1 parent
13bbc34
commit 02be742
Showing
14 changed files
with
239 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package client | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"math/big" | ||
"testing" | ||
|
||
"github.com/0xPolygonHermez/zkevm-node/log" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestZkevmGetBatch(t *testing.T) { | ||
t.Skip("This test is exploratory") | ||
// Create a new client | ||
client := NewClient("https://zkevm-rpc.com/") | ||
lastTrustedStateBatchNumberSeen, err := client.BatchNumber(context.Background()) | ||
require.NoError(t, err) | ||
log.Info("lastTrustedStateBatchNumberSeen: ", lastTrustedStateBatchNumberSeen) | ||
batch, err := client.BatchByNumber(context.Background(), big.NewInt(int64(lastTrustedStateBatchNumberSeen))) | ||
require.NoError(t, err) | ||
|
||
// Print the batch | ||
fmt.Println(batch) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package l2_sync | ||
|
||
// Config configuration of L2 sync process | ||
type Config struct { | ||
// AcceptEmptyClosedBatches is a flag to enable or disable the acceptance of empty batches. | ||
// if true, the synchronizer will accept empty batches and process them. | ||
AcceptEmptyClosedBatches bool `mapstructure:"AcceptEmptyClosedBatches"` | ||
} |
Oops, something went wrong.