Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into siliev/upgrade-hardha…
Browse files Browse the repository at this point in the history
…t-to-plugin
  • Loading branch information
StefanIliev545 committed Feb 29, 2024
2 parents c140f4b + a231667 commit f918b1f
Show file tree
Hide file tree
Showing 37 changed files with 1,674 additions and 1,129 deletions.
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
---
# Ten Testnet Change Log

# Feb 2024-02-27 (v0.23.0)
* An upgrade release to fix issues in the batch limit size which can stop deployment of some large contracts, and to
over-estimate the L1 gas cost to ensure it is possible to submit a transaction for rollup.
* A full list of the PRs merged in this release is as below;
* `21860c19` Overestimate L1 gas costs (#1821)
* `5e057c69` Switch primary and secondary fonts on gateway and tenscan (#1819)
* `d43ae52c` Batch limit: increase max to 36kb (#1817)
* `33d3de82` Network test: local network qol (#1818)
* `b7bea2c4` Fix mutex error (#1810)
* `25f4f5b6` Networktests: add options for test users to use gateway (#1806

# Feb 2024-02-20 (v0.22.0)
* Validator nodes now return errors on transaction submission. Previously, transactions that would fail validation were
accepted into the mempool of the validator without error (e.g. insufficient funds for a transfer, gas below the
Expand Down
5 changes: 4 additions & 1 deletion go/common/enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ type Enclave interface {
// GetBatch - retrieve a batch if existing within the enclave db.
GetBatch(hash L2BatchHash) (*ExtBatch, SystemError)

// GetBatchBySeqNo - retrieve batch by sequencer number if it's in the db
// GetBatchBySeqNo - retrieve batch by sequencer number if it's in the db.
GetBatchBySeqNo(seqNo uint64) (*ExtBatch, SystemError)

// GetRollupData - retrieve the first batch sequence and start time for a given rollup.
GetRollupData(hash L2RollupHash) (*PublicRollupMetadata, SystemError)

// CreateBatch - creates a new head batch extending the previous one for the latest known L1 head if the node is
// a sequencer. Will panic otherwise.
CreateBatch(skipIfEmpty bool) SystemError
Expand Down
6 changes: 6 additions & 0 deletions go/common/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ type CalldataRollupHeader struct {
ReOrgs [][]byte `rlp:"optional"` // sparse list of reorged headers - non null only for reorgs.
}

// PublicRollupMetadata contains internal rollup data that can be requested from the enclave.
type PublicRollupMetadata struct {
FirstBatchSequence *big.Int
StartTime uint64
}

// MarshalJSON custom marshals the RollupHeader into a json
func (r *RollupHeader) MarshalJSON() ([]byte, error) {
type Alias RollupHeader
Expand Down
26 changes: 26 additions & 0 deletions go/common/rpc/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,29 @@ func FromRollupHeaderMsg(header *generated.RollupHeaderMsg) *common.RollupHeader
LastBatchSeqNo: header.LastBatchSeqNo,
}
}

func ToRollupDataMsg(rollupData *common.PublicRollupMetadata) generated.PublicRollupDataMsg {
if rollupData == nil {
return generated.PublicRollupDataMsg{}
}

return generated.PublicRollupDataMsg{StartSeq: rollupData.FirstBatchSequence.Uint64(), Timestamp: rollupData.StartTime}
}

func FromRollupDataMsg(msg *generated.PublicRollupDataMsg) (*common.PublicRollupMetadata, error) {
if msg.Timestamp == 0 {
return nil, fmt.Errorf("timestamp on the rollup can not be zero")
}

if msg.StartSeq == 0 {
return &common.PublicRollupMetadata{
FirstBatchSequence: nil,
StartTime: msg.Timestamp,
}, nil
}

return &common.PublicRollupMetadata{
FirstBatchSequence: big.NewInt(int64(msg.StartSeq)),
StartTime: msg.Timestamp,
}, nil
}
Loading

0 comments on commit f918b1f

Please sign in to comment.