Skip to content

Commit fbc0621

Browse files
committed
pkg/config: add func SizeOf; pkg/settings: defaults/types/comments
1 parent e5da126 commit fbc0621

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

pkg/config/bytes.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ var (
3232
}
3333
)
3434

35+
func SizeOf[B ~[]byte](b B) Size {
36+
return Size(len(b))
37+
}
38+
3539
func (b Size) MarshalText() ([]byte, error) {
3640
if b >= TByte {
3741
d := decimal.NewFromInt(int64(b)).Div(decimal.NewFromInt(int64(TByte)))

pkg/settings/cresettings/settings.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ var Default = Schema{
9191
TargetsLimit: Int(3),
9292
ReportSizeLimit: Size(config.KByte),
9393
EVM: evmChainWrite{
94-
TransactionGasLimit: Int(-1), //TODO
94+
TransactionGasLimit: Uint64(500_000),
9595
},
9696
},
9797
ChainRead: chainRead{
9898
CallLimit: Int(3),
99-
LogQueryBlockLimit: Int(100),
99+
LogQueryBlockLimit: Uint64(100),
100100
PayloadSizeLimit: Size(5 * config.KByte),
101101
},
102102
},
@@ -187,11 +187,11 @@ type chainWrite struct {
187187
EVM evmChainWrite
188188
}
189189
type evmChainWrite struct {
190-
TransactionGasLimit Setting[int] `unit:"{gas}"`
190+
TransactionGasLimit Setting[uint64] `unit:"{gas}"`
191191
}
192192

193193
type chainRead struct {
194-
CallLimit Setting[int] `unit:"{call}"`
195-
LogQueryBlockLimit Setting[int] `unit:"{block}"`
194+
CallLimit Setting[int] `unit:"{call}"`
195+
LogQueryBlockLimit Setting[uint64] `unit:"{block}"`
196196
PayloadSizeLimit Setting[config.Size]
197197
}

pkg/settings/limits/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type ResourceLimiter[N Number] interface {
2424
Use(ctx context.Context, amount N) error
2525
// Free is the counterpart to Use and releases amount of resources from use.
2626
Free(ctx context.Context, amount N) error
27-
// Available returns
27+
// Available returns the available remaining capacity.
2828
Available(ctx context.Context) (N, error)
2929
}
3030

0 commit comments

Comments
 (0)